question

Stan Davis avatar image
1 Like"
Stan Davis asked Phil BoBo edited

Node On Arrival Trigger Fires On Exit

I'm trying to develop some labor tracking logic using node entry/exits, but I am having trouble understanding why the On Arrival trigger is firing when an operator exits an endpoint node.

What is being observed seems to indicate the operator may not be physically be sitting at the node after entering. When a resource is parked at a node, is it not actually at the node? I did set the Operator to not travel offsets and block space on networks, but On Arrival still fired on exit.

I attached a small test model demonstrating what is being observed.

Node On Arrival Logic Test.fsm


I did find a previously answered question on this topic but the scenario is a little different...

https://answers.flexsim.com/questions/43656/network-node-onarrive-trigger-not-firing.html

Also, I am not completely understanding 'toedge' and 'fromedge' . The manual does not clearly define what these represent.

Thanks

FlexSim 21.2.2
triggersnodes
5 |100000

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

1 Answer

Phil BoBo avatar image
0 Likes"
Phil BoBo answered Phil BoBo edited

The documentation for Network Node On Arrival and On Continue is here: Network Node (flexsim.com)

This is all working as intended. When the traveler arrives at NN3, it fires the OnArrival trigger with fromedge 1 and toedge 0. The toedge is 0 because that it the operator's final destination; he isn't continuing onto another network node path at the time. It then fires the OnContinue trigger with fromedge 1 and toedge 0, indicating that the operator has finished the travel operation to that node.

When the traveler begins traveling again, it fires the On Arrival of NN3 indicating that the operator is beginning to travel again, arriving at that node as the first node of the new travel task. If he is blocking space on the network, then the fromedge will be whatever edge he came from previously (1 in this case). If he left the network to do offset travel, then the fromedge will be 0. Then the OnContinue trigger fires indicating that the operator is continuing to travel through that node with the toedge being the path he is about to start traveling on.

It fires OnArrival and OnContinue in that order for every involved network node along an operator's travel path along the network. You have callbacks at every important event during the operator's travel task.

I don't understand what you mean by "fired on exit." Exit of what? What is exiting? When he finishes a travel task, he is arriving at that node, so it is firing OnArrival. When he begins another travel task, he is arriving at that node, so it fires OnArrival. You have all the callbacks you need with all the parameters you need in order to make a decision at each event involved with the operator traveling to, through, or from a network node.

See the attached model with print statements in OnArrival and OnContinue showing what is happening and when.

node-on-arrival-logic-test_1.fsm


· 5
5 |100000

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

Stan Davis avatar image Stan Davis commented ·

These are the parts that are throwing me...

"When the traveler begins traveling again, it fires the On Arrival of NN3 indicating that the operator is beginning to travel again, arriving at that node as the first node of the new travel task"..

...

"When he begins another travel task, he is arriving at that node, so it fires OnArrival"

...

7.46 /Operator1 has continued from /NN3 from edge 1 going to edge 0

(Continuing to where? he is at the end of the network.)

...

"It then fires the OnContinue trigger with fromedge 1 and toedge 0, indicating that the operator has finished the travel operation to that node"


I think my basic misunderstanding is that I am assuming the operator is staying at the end node NN3 after he initially arrives because NN3 is connected to his destination. So when he travels again headed back home, he would not fire the OnArrival trigger since he is already at the node. That is what I meant by exiting [NN3]. If he doesn't stay at NN3 after arrival, where is he during the delay ?? Does he leave the network? Thanks

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Stan Davis commented ·

(Continuing to where? he is at the end of the network.)

Exactly. That's why toedge is 0. You can use that variable to know when he is at the end of his travel task along the network. The "to where" depends on his travel offsets setting. If he is traveling offsets, then the "to where" is entirely off the network. He will travel wherever he is told, entirely off the network. If he is not traveling offsets, then the "to where" is off the network, but standing exactly at the node's location in 3D space. If he is not traveling offsets and blocking space, then the "to where" is blocking space at that node despite no longer traveling on the network. He's finished his travel task along the network, but you've purposefully configured him so that he still blocks space on the network even when he isn't traveling on it. In all three cases, he has finished his travel task along the network and arrived and continued through each involved node along the way. When you give him another task, he will again travel along the network and arrive/continue through each involved node along the way.

Your misunderstanding is in assuming that it does what you think it does instead of determining what it actually does and then writing your logic accordingly. Now that you know what it does, write your logic accordingly. Check the toedge and fromedge variables to determine whether the callback was the end of a travel task or beginning of a travel task if you want to ignore those cases for your logic.

0 Likes 0 ·
Stan Davis avatar image Stan Davis Phil BoBo ♦♦ commented ·

Understood. I did initially assume but I was trying to determine what it actually does. That was the whole point of posting the question on this site with an example model. Little harsh on the end. And maybe add some clarity in the manual. Thanks.

0 Likes 0 ·
Show more comments