Stop entity generator block then release it upon condition in SimEvents

468 Views Asked by At

I am using "Time-Based Entity Generator" and I need to control the entities generation. For example, if Simulation Clock < 100 stop generation and else set interarrival time = 1.

I tried this:

if SimClk < 100

    IntARR = inf;
else
    IntARR = 1;
end

It didn't work as when the interarrival time set to be Inf, It stopped generation and cannot return back.

Any help ?!

1

There are 1 best solutions below

0
On

In your example you could use the following Matlab Action script :

persistent once;
if isempty(once)
    dt=100;
    once=1;
else
    dt=1;
end

Also uncheck the option "Generate entity at simulation start".