Incomplete trajectory after do_parallel or clone/trap/syncronize #307
Replies: 2 comments 2 replies
-
The issue is that you have too many things happening at the same time. Several ...
timeout(0) |>
send(signal) |>
... etc. We may need to add those null timeouts in the |
Beta Was this translation helpful? Give feedback.
-
I finished testing this on my simple example and my more complex version.
I also added Fantastic package. Thanks again for your help. |
Beta Was this translation helpful? Give feedback.
-
Problem
The main trajectory does not always complete after using
simmer.bricks::do_parellel
orclone
,trap
, andsynchronize
.Attributes and logs execute up until
synchronize()
, then cease.get_mon_arrivals
shows all end_times as NA (note: in a more complicated version of this, some transactions did complete, but the majority do not.)Why is this happening, and how can I ensure all transactions complete the main trajectory after the parallel?
Background
In this simulation, customers decide to buy item_1, item_2, or both based on a purchase probability. They must buy at least one item, so there is also a failsafe that if neither item is purchased, it forces a purchase of item_1.
Clerks prepare the orders for the customer. Any clerk may perform any task but only one task per clerk at a time. Each item has a different purchase trajectory, which competes for a common resource (clerks).
When multiple clerks are available, the items may be prepared simultaneously, so the purchase trajectories are performed in parallel.
testing with
log_()
andset_attribute()
I have determined that the trajectories withindo_parallel
(orclone
) are executing as expected. but the synchronization never occurs.The Code
Log
From this, I see that customer0 bought item_1 not item_2 and was not forced to make a purchase. Because there was no item 2 purchased or forced purchase, those trajectories are immediately complete and start waiting to sync. When the clerk finishes preparing item 1, it waits to sync; however, this is the last trajectory, so we should then see a log_ entry for "sync'd" but do not. The trajectories never sync.
Customer1 chooses neither option so is forced to buy item 1. Again, all trajectories complete, but do not synchronize.
Other Trouble Shooting
do_parellel
yields the same issueThank you in advance for your help and for creating/maintaining this package; it is awesome.
Beta Was this translation helpful? Give feedback.
All reactions