Possible function that makes a value in a variable wait a specified amount of time each time a condition becomes true

58 views Asked by At

With the delay function in Anylogic, is there a way to not take the delay time from the start of the simulation, but from the point at which the delay is "triggered"?

Picture of my SystemDyamics System

1

My code:

complexity <= 2 ? 
(stressresponse + boredom) <= 2 && wellbeing >= 0.8 ?
delay(0.3, 10)
:0
:complexity > 2 && complexity <= 5 ?
(Stressreaktion + Langeweile) <= 2 && Wohlbefinden >= 0.8 ?
delay(0.6, 4)
:0
:complexity > 5 && complexity <= 8 ?
(stressresponse + boredom) <= 2 && wellbeing >= 0.8 ?
delay(0.8, 3)
:0
:complexity > 8 && complexity <= 10 ??
(stressresponse + boredom) <= 2 && wellbeing >= 0.8 ?
delay(1, 2)
:0
:0

I want the respective value (0.3 ; 0.6 ; 0.8 or 1) to take effect only after a certain time. The problem is that the delay time in the respective function does not restart every time the previous conditions become true. I need it so that the delayTime is waited every time the conditions become true.

0

There are 0 answers