Randomness Seed, delay task

nina_a
Not applicable
0 Views
7 Replies
Message 1 of 8

Randomness Seed, delay task

nina_a
Not applicable

[ FlexSim 20.0.10 ]

Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);
/***popup:StatisticalDistribution*/


double ASRS_speed = 1.0;  // Set your ASRS speed (you can adjust this value accordingly)

/***popup:StatisticalDistribution*/

// Define initial mean and standard deviation
double initialMean = 9;
double initialStdDev = 1.19;

// Adjust mean and standard deviation based on ASRS speed
double adjustedMean = initialMean / ASRS_speed;
double adjustedStdDev = initialStdDev / ASRS_speed;

// Generate random delays using normal distribution
double random = normal(adjustedMean, adjustedStdDev, getstream(activity));

return random;

Hello everyone , in my delay task I have this custom code. I use this delay to introduce randomness and uncertainty in my system. I run my scenario for 100 times, however in mnay repetitions i get the same results. In order to avoid that, I think I have to seed a randomness seed ,so in every run different numbers are used. Is there a way to do that ?

Thank you in advance.

0 Likes
Accepted solutions (1)
1 View
7 Replies
Replies (7)
Message 2 of 8

krzysztof_j
Not applicable
Accepted solution

Hi,

it depends on what you mean by "run scenario for 100 times". If you are using experimenter module it is ok (see attached model). If you do it manually you need to uncheck option "repeat Random Streams" (Statistics Tab).

Grecja_konsultacja.fsm

0 Likes
Message 3 of 8

nina_a
Not applicable

I am doing it manually ! I read in another thread that is better to uncheck the repeat Random Sreams.


0 Likes
Message 4 of 8

krzysztof_j
Not applicable

Exactly - I should write "uncheck" instead of "check". I have corrected my answer.

0 Likes
Message 5 of 8

nina_a
Not applicable
Great ! thank you so much for your help !!
0 Likes
Message 6 of 8

jason_lightfootVL7B4
Autodesk
Autodesk
No - don't uncheck repeat random streams - you cannot control it then or reproduce any error you might see to help debugging.

To run different random results manually it's better to change the experimenter setting .

0 Likes
Message 7 of 8

jason_lightfootVL7B4
Autodesk
Autodesk

Change the experimenter setting to repeat stream of replication number on the advanced tab:

1697458665015.png

0 Likes
Message 8 of 8

jason_lightfootVL7B4
Autodesk
Autodesk

Hi @Rania A, was one of Krzysztof J's or Jason Lightfoot'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 comment back to reopen your question.

0 Likes