Close input
Close input
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?
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?
-
- Posts: 60
- Joined: Thursday 08 January, 2015 - 13:29
Re: Close input
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
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
- Attachments
-
- TimeControl.mod
- (8.21 KiB) Downloaded 375 times
Re: Close input
Ahh I get it now! Thank you so much!
Re: Close input
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
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?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
-
- Posts: 60
- Joined: Thursday 08 January, 2015 - 13:29
Re: Close input
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
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
- Attachments
-
- TimeControl2.mod
- (10.6 KiB) Downloaded 360 times