question

Mario García López avatar image
0 Likes"
Mario García López asked jc commented

How to choose travel network path for a taskexecuter

I have a travel network node system in which the taskexecuter goes through the wrong path, I want to choose the correct path that I want. How can I do this?

FlexSim 24.1.0
network nodestravel networksnodes
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

jc avatar image
0 Likes"
jc answered jc commented

Hi, @Mario García López!
I am not sure if this is what you wanted but I changed the "on arrival" code of your node to this:

if (traveler == Model.find("TaskExecuter1") && fromedge == 1) {

return 2;

} else if (traveler == Model.find("TaskExecuter2") && fromedge == 1) {

treenode newDestination = Model.find("NN11");

redirectnetworktraveler(traveler,newDestination);

return 3;

}


I think it works as you wanted it to work but if you have any concern please let us know.
path.fsm



path.fsm (32.2 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Mario García López avatar image Mario García López commented ·

It actually worked! Thank you so much. One more thing if possible... The second taskexecuter starts its work when there are more than one box in the queu. If there are only one, the first taskexecuter returns to get the box, even if the distance is much longer than the other taskexecuter.

How can I make sure that the taskexecuter in charge of the task is the one closest to the next task?

All the best.

0 Likes 0 ·
jc avatar image jc Mario García López commented ·

Hi, @Mario García López

In the dispatcher options you can explore different options for instance ths one:

"Shortest distance if available"
1721200509585.png

0 Likes 0 ·
1721200509585.png (33.0 KiB)
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Mario García López commented

You can edit path option to be not connected. A network node has a connections (edge) to another. You can disconnect it by code or by attribute variable.

alternatively you can add travel tasks to networknodes by which a taskexecuter must go to reach a station. While reaching a destination of a Tasksequence next task will be evaluated to plan next destination by shortest distance. So you don’t need all network nodes being a destination but a few or only one to divert a taskexecuter.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·
You can also return the output connection/edge number you want the traveller to take in the Network Node's OnArrival trigger to encourage it to take a different route.
1 Like 1 ·
Mario García López avatar image Mario García López Jason Lightfoot ♦♦ commented ·

Thanks! I think it should be the best solution, but i am not able to get it done. Moreover i would like that each of the task executers choose the output and go through different path

Could you help me? Path.fsm

0 Likes 0 ·
path.fsm (33.7 KiB)