question

Emily K avatar image
0 Likes"
Emily K asked Emily K commented

Using decide activity to stop simulation based on input value

0511.fsmHi there,

I am trying to stop the simulation when the input value of Queue8 reached 10, I use decide > conditional decide > Model.find("Queue7").as(Object).stats.input.value==10

But it doesn't work...

Are there any suggestions? Thanks!

FlexSim 21.1.5
processflowdecideinput value
0511.fsm (551.0 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.

1 Answer

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered Emily K commented

@Emily K If you put a decide in you have to have 2 exits. You currently have only 1 exit on the decide but if the queue content == 10 it should go to exit 2. But there is no exit 2 so it doesn't go anywhere. You can also see that because all your tokens stay in your decide. So simply add a custom code activity and connect it from the decide to this activity and put the code stop(0) in that custom code activity and you should be good to go.

· 3
5 |100000

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

Emily K avatar image Emily K commented ·

Thank you Steven for giving suggestion :)

But I would like to stop the simulation, when the total input of Queue8 == 10 not current content of Queue8 == 10

Is it correct to use this code?

Model.find("Queue8").as(Object).stats.input.value==10

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Emily K commented ·
That is correct.
0 Likes 0 ·
Emily K avatar image Emily K Jason Lightfoot ♦♦ commented ·
Thank you so much!
0 Likes 0 ·