question

wooram-kim avatar image
0 Likes"
wooram-kim asked David Seo commented

Event-Triggered Source with OnResourceAvailable generates an unexpected token

Event-Triggered Source with OnResourceAvailable generates a token after the resource is resumed even though it has a task sequence to fulfil.

In the attached mode (OnResourceAvailable.fsm), the man goes right 10 m and then, he goes left by 10 m. The man repeat this movement because I used Event-Triggered Source with OnResourceAvailable. If I stop and resume the man while he moves, the Source make a new token and the existing token does not move anymore. In case of using one time source, the exsisting token works as well as I expected.

Is it intended that the source make a new token? What happened to the existing token?


Thank you.

FlexSim 24.1.1
event-triggered sourceon resource available
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered David Seo commented

This is intended. Stopping a task executer really just dispatches a preempting task sequence to it. When the TE is resumed this task sequence finishes, firing the On Resource Available event.

1737539336437.png

This is why pickoption like "Travel to a Home Location" by default have a condition that prevents them from doing anything if the task sequence queue is not actually empty.

1737539415554.png

You can do the same in Process Flow by checking whether the "Next TS" parameter of the event holds a valid TS or not.

1737539684299.png


Previously the original token gets stuck due to how the timing works. When the event fires the original task sequence is the queue. Due to this the newly created TS immediately becomes the active sequence, locking the original TS in the queue forever.


1737539336437.png (5.3 KiB)
1737539415554.png (4.5 KiB)
1737539684299.png (61.5 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.