You can find which path a task executer on with the code below. But I don't think you can directly go the opposite way and find task executers on a given path.
treenode agvNode = AGV(Model.find("TaskExecuter1"));
treenode travelSection = getsdtvalue(agvNode, "atTravelSection");
if(!travelSection)
{
travelSection = agvNode.find("/travelPath").first;
}
Object curPath = travelSection.value;
return curPath;
You could look at the allocations of control points on that path, but the accurary will depend on the placement of the points, since they could be allocated before entering the path or still be allocated after leaving it.
For what purpose do you want to read this information? If you just need it for a few paths, you could use way points that increment/decrement a counter on Pre-Arrival of a task executer.