Skip to Main Content Skip to Search
Product Documentation

Keeping a Gate Open Over a Time Interval

Behavior of Enabled Gate Block

The Enabled Gate block uses a control signal at the input port labeled en to determine when the gate is open or closed:

Because the en signal can remain positive for a time interval of arbitrary length, an enabled gate can remain open for a time interval of arbitrary length. The length can be zero or a positive number.

Depending on your application, the gating logic can arise from time-driven dynamics, state-driven dynamics, a SimEvents block's statistical output signal, or a computation involving various types of signals. The en signal must be an event-based signal. To convert a time-based signal into an event-based signal, use the Timed to Event Signal block.

Example: Controlling Joint Availability of Two Servers

Suppose that each entity undergoes two processes, one at a time, and that the first process does not start if the second process is still in progress for the previous entity. Assume for this example that it is preferable to model the two processes using two Single Server blocks in series rather than one Single Server block whose service time is the sum of the two individual processing times; for example, you might find a two-block solution more intuitive or you might want to access the two Single Server blocks' utilization output signals independently in another part of the model.

If you connect a queue, a server, and another server in series, then the first server can start serving a new entity while the second server is still serving the previous entity. This does not accomplish the stated goal. The model needs a gate to prevent the first server from accepting an entity too soon, that is, while the second server still holds the previous entity.

One way to implement this is to precede the first Single Server block with an Enabled Gate block that is configured so that the gate is closed when an entity is in either server. In particular, the gate

This arrangement is shown below.

The Signal Latch block's st output signal becomes 0 when the block's rvc input signal increases and becomes 1 when the wvc input signal increases. That is, the st signal becomes 0 when an entity departs from the gate and becomes 1 when an entity departs from the second server. In summary, the entity at the head of the queue advances to the first Single Server block if and only if both servers are empty.

  


Free Discrete Event Simulation Technical Kit

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS