issue with experimenter

issue with experimenter

lokesh_gp
Not applicable
29 Views
10 Replies
Message 1 of 11

issue with experimenter

lokesh_gp
Not applicable

[ FlexSim 22.0.1 ]

rfidproject.fsm

when i run the experimenter, it is not considering trigger logic given in processor.screenshot-4143.png

it just runs the experiment for one hour and i get same output for all scenarios.i have parameters and assigned some values to them and set a scenario for each of parameter level so i need to get a different output for scenarios.

can someone help what needs to be done?

0 Likes
Accepted solutions (1)
30 Views
10 Replies
Replies (10)
Message 2 of 11

moehlmann_fe
Participant
Participant
Accepted solution

"stop()" doesn't work with the experimenter or optimizer. Use "endreplication(1)" instead. Depending on which trigger you are using, you might have to send a delayed message and then run the command in the message trigger, instead of directly in the first trigger.

(endreplication deletes all pending events, if the trigger it is called in creates a new event, the replication won't stop)

1650375169089.png

1650375196826.png

Message 3 of 11

lokesh_gp
Not applicable

thanks for the reply.

rfidproject.fsm

i don't know where to add the codes. can you please add required code in this file. i will check and learn.

thanks in advance

0 Likes
Message 4 of 11

moehlmann_fe
Participant
Participant

The "senddelayedmessage" you use instead of the "stop()" in the On Process Finish trigger. And the "endreplication(1)" in the "On Message" trigger (as you can actually see by the name of the tab in the screenshot).

1650382808525.png

rfidproject_1.fsm

0 Likes
Message 5 of 11

lokesh_gp
Not applicable

thanks for the help.

i expect results in this values


screenshot-2022-04-20-115122.jpg


but the result which i get in simulation is of this values.

screenshot-2022-04-20-115512.jpg

this is the trigger code i used.

if(uniform(0,1,getstream(current)) < Model.parameters.conveyorspeed * Model.parameters.tagposition * Model.parameters.materials)

{

senddelayedmessage(current, 0, current);

}

is there any problem with random number generation as scenario stops with single product read?


what i need to do or correct to obtain some valid results?

0 Likes
Message 6 of 11

moehlmann_fe
Participant
Participant
That depends on what your parameters represent (chance for successful read, or chance of failure) and how they interact. Under the assumption that they represent the chance of a successful read and are independent from each other then to total success chance would be P(a,b,c) = P(a)*P(b)*P(c), where P(x) is the individual probability.

In that case the random number would have to be larger than the success chance to signify a failure. For example, the success chance is 0.8. A failure would occur if the random number is larger than 0.8; in 20% of the cases.

In your code you are checking if the number lower. That would be correct if the product of your numbers represents the total failure chance.
0 Likes
Message 7 of 11

lokesh_gp
Not applicable

if(uniform(0,1,getstream(current)) > Model.parameters.conveyorspeed * Model.parameters.tagposition * Model.parameters.materials)

{

senddelayedmessage(current, 0, current);

}

screenshot-2022-04-20-123238.jpg


chance of successful read is the desired outcome. so i changed the 'decrease' to 'increase' sign in trigger so the random number generated should be greater than product of those probability to denote failure. so why is the result same for all scenario. i should be able to get different outputs for scenarios but get 4 for all. so what is cause for this bias? is there any issue with random number generation?

0 Likes
Message 8 of 11

moehlmann_fe
Participant
Participant

When I run the experimenter in the model attached above I get the following results:

1650441572009.png

I can't really tell what might be going wrong in your case without seeing your current model, though.

0 Likes
Message 9 of 11

lokesh_gp
Not applicable

rfidproject-1.fsm

sorry, i changed some parameter values.

i could not understand why the read redundancy is not increasing after 4. please suggest the solution to the problem.


0 Likes
Message 10 of 11

moehlmann_fe
Participant
Participant

It seems like it's a statistical artifact due to the way the random number generator works. The N-th replication for each scenario will use the same random number stream (effectively the same sequence of "random" numbers). In the case of the first replication, that stream returns 0.97 as the fourth generated number. Because it is quite high, this always resulted in a failure and lead to the same overall result.

Because the design of your experiment (only run until first failure) results in a very small sample size per replication you'd need to run many more replications to reduce the statistical error of your results.
Below are the results for 50 replications. As you can see it results in a much wider spread of values.

1650445478857.png

0 Likes
Message 11 of 11

lokesh_gp
Not applicable
thanks for the help!
0 Likes