question

Rania A avatar image
0 Likes"
Rania A asked Jason Lightfoot commented

Randomness Seed, delay task

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.

FlexSim 20.0.10
delayrandomnessseed
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

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 0 ·
Krzysztof J avatar image
-1 Like"
Krzysztof J answered Jason Lightfoot commented

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


· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Rania A avatar image Rania A commented ·

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


0 Likes 0 ·
Krzysztof J avatar image Krzysztof J Rania A commented ·

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

0 Likes 0 ·
Rania A avatar image Rania A Krzysztof J commented ·
Great ! thank you so much for your help !!
0 Likes 0 ·
Show more comments
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

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

1697458665015.png


1697458665015.png (6.4 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.