Page 1 of 1

Close input

Posted: Wednesday 12 August, 2015 - 17:18
by linfinity
Hi,

I have a problem. A store is open for 3 hours. After 3 hours I would like to close the input of the source but still run the model till every costumer is done.
I wanted to close the input after 3 hours and let the model run 1 more hour.
I tried it with condition control, but I didn't know what to put in the boxes.
How can I solve this problem?

Re: Close input

Posted: Thursday 13 August, 2015 - 09:04
by Bram de Vries
Hello linfinity,

I made a small example model which shows some functionality to achieve what you are looking for. You can find it in the attachment.

What happens in the send to of the source is that when the simulation time (4d script command Time) is lower than 3 hours, the products are sent to output channel 1 (i.e. the store) and afterwards they are sent to a sink (and so leave the model immediately). I hope this helps you along!

Kind regards,

Bram

Re: Close input

Posted: Friday 14 August, 2015 - 13:12
by linfinity
Ahh I get it now! Thank you so much!

Re: Close input

Posted: Friday 14 August, 2015 - 13:42
by linfinity
It worked, but the source already has 'send to: smallest queue', because I have two queues. So I can't put If(Time < hr(3),1,2), how do I solve this?

Re: Close input

Posted: Sunday 16 August, 2015 - 14:39
by linfinity
Bram de Vries wrote:Hello linfinity,

I made a small example model which shows some functionality to achieve what you are looking for. You can find it in the attachment.

What happens in the send to of the source is that when the simulation time (4d script command Time) is lower than 3 hours, the products are sent to output channel 1 (i.e. the store) and afterwards they are sent to a sink (and so leave the model immediately). I hope this helps you along!

Kind regards,

Bram
It worked, but the source already has 'send to: smallest queue', because I have two queues. So I can't put If(Time < hr(3),1,2), how do I solve this?

Re: Close input

Posted: Monday 17 August, 2015 - 09:04
by Bram de Vries
Hello linfinity,

I added an example model which provides a different method. I used a user event atom to schedule that the output of the source will be closed after three hours. Please refer to the code in the GUI of the User Event for more information. One thing that I had to do is schedule the User event 3 hours from the start of the simulation (I did this using an Initialize atom).

Kind regards,

Bram