Here's another possibility with custom code. In the source activity, we set a label "keep". At the beginning of each cycle, we shuffle an array with possible paths and then assign them to each token based upon it's index. This code can be found in the Source activity under the Custom Code value.test1.fsm
The attached file uses a Global Table to evaluate Arrival and Departure times for each token. First, change the Source quantity to produce the total number of items to be delivered that day (5). The Assign Labels activity does 5 things:
1. Assigns a random Label to the token (1-10)
2. Looks at the Global table to find the Arrival/Departure times
3. Converts both Arrival and Departure times into seconds
4. Calculates correct arrival time in the model
5. Calculates Processing time (between arrival and departure)
The first delay activity waits for each arrival time to be reached (DelayTime for each). The second delay lasts for the Processing Duration.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.