Close input

All topics on the Atoms in any Enterprise Dynamics Library.
Post Reply
linfinity
Posts: 6
Joined: Wednesday 12 August, 2015 - 15:20

Close input

Post by linfinity » Wednesday 12 August, 2015 - 17:18

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?

Bram de Vries
Posts: 60
Joined: Thursday 08 January, 2015 - 13:29

Re: Close input

Post by Bram de Vries » Thursday 13 August, 2015 - 09:04

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
Attachments
TimeControl.mod
(8.21 KiB) Downloaded 184 times

linfinity
Posts: 6
Joined: Wednesday 12 August, 2015 - 15:20

Re: Close input

Post by linfinity » Friday 14 August, 2015 - 13:12

Ahh I get it now! Thank you so much!

linfinity
Posts: 6
Joined: Wednesday 12 August, 2015 - 15:20

Re: Close input

Post by linfinity » Friday 14 August, 2015 - 13:42

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?

linfinity
Posts: 6
Joined: Wednesday 12 August, 2015 - 15:20

Re: Close input

Post by linfinity » Sunday 16 August, 2015 - 14:39

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?

Bram de Vries
Posts: 60
Joined: Thursday 08 January, 2015 - 13:29

Re: Close input

Post by Bram de Vries » Monday 17 August, 2015 - 09:04

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
Attachments
TimeControl2.mod
(10.6 KiB) Downloaded 186 times

Post Reply