| Contents | Index |
| On this page… |
|---|
Schematic Illustrating Procedure Step 1: Designate the Entity Path |
This section describes a typical procedure for incorporating timeout events into your model. The schematic below illustrates the procedure for a particular topology.

Designate the entity path on which you want to limit entities' time. The path can be linear, with exactly one initial block and one final block, or the path can be nonlinear, possibly with multiple initial or final blocks. Insert Schedule Timeout and Cancel Timeout blocks as follows:
Insert a Schedule Timeout block before each initial block in the path. The Schedule Timeout block schedules a timeout event on the event calendar whenever an entity arrives, that is, whenever an entity enters your designated path.
Insert a Cancel Timeout block after each final block in the path, except final blocks that have no entity output port. The Cancel Timeout block removes a timeout event from the event calendar whenever an entity arrives, that is, whenever an entity leaves your designated path without having timed out. If a final block in the path has no entity output port, then the block automatically cancels the timeout event.
Configure the Schedule Timeout and Cancel Timeout blocks with the same Timeout tag parameter. The timeout tag is a name that distinguishes a particular timeout event from other timeout events scheduled for different times for the same entity.
For sample topologies, see Defining Entity Paths on Which Timeouts Apply.
Specify the timeout interval, that is, the maximum length of time that the entity can spend on the designated entity path, by configuring the Schedule Timeout block(s) you inserted:
If the interval is the same for all entities that arrive at that block, you can use a parameter, attribute, or signal input. Indicate your choice using the Schedule Timeout block's Timeout interval from parameter.
If each entity stores its own timeout interval in an attribute, set the Schedule Timeout block's Timeout interval from parameter to Attribute.
This method is preferable to using the Signal port ti option with a Get Attribute block connected to the ti port; to learn why, see Interleaving of Block Operations.
If the timeout interval can vary based on dynamics in the model, set the Schedule Timeout block's Timeout interval from parameter to Signal port ti. Connect a signal representing the timeout interval to the ti port.
If the ti signal is an event-based signal, be sure that its updates occur before the entity arrives. For common problems and troubleshooting tips, see Unexpected Use of Old Value of Signal.
Specify where an entity goes if it times out during the simulation:
Enable the TO entity output port for some or all queues, servers, and Output Switch blocks along the entity's path, by selecting Enable TO port for timed-out entities on the Timeout tab of the block's dialog box. In the case of the Output Switch block, you can select that option only under certain configurations of the block; see its reference page for details.
If an entity times out while it is in a block possessing a TO port, the entity departs using that port.
If an entity times out while it resides in a block that has no TO port, then the Schedule Timeout block's If entity has no destination when timeout occurs parameter indicates whether the simulation halts with an error or discards the entity while issuing a warning.
Queues, servers, and the Output Switch block are the only blocks that can possess TO ports. For example, an entity cannot time out from gate or attribute blocks.
For examples of ways to handle timed-out entities, see Handling Entities That Time Out.
![]() | Basic Example Using Timeouts | Defining Entity Paths on Which Timeouts Apply | ![]() |

Learn how you can use SimEvents discrete-event simulation capabilities through these technical resources.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |