Hi Team,
I have 10 arrival slots available as below:
How to choose 5 slots randomly daily basis?
Thank you!
Hi Team,
I have 10 arrival slots available as below:
How to choose 5 slots randomly daily basis?
Thank you!
Hi @Ankur A3, was one of Kavika F's or Jonah K's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.
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
Thanks for your answer!
Since we are defining the array manually with 10 elements, I don't feel it is having scalability if we are changing number of slots.
Thank you!
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.
Does this answer your question?
Sorry about that. Here is some of the data I used in my example.
The Assign Labels Activity:
The DelayTime Custom Code:
/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
Variant assignTo = param(4);
string labelName = param(5);
treenode processFlow = ownerobject(activity);
DateTime dt = DateTime(token.ArrDateTime);
DateTime sdt = DateTime.compose(
Model.startDateTime.year,
Model.startDateTime.month,
Model.startDateTime.day
);
DateTime dt2 = dt - (Model.startDateTime - sdt);
return dt2;
The Model Layout:
And the Global Table:
Hope this helps.
16 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
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.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved