Documentation

Generate Multiple Entities at Time Zero

In a discrete-event simulation, an event is an observation of an instantaneous incident that may change a state variable, an output, and/or the occurrence of other events.

Suppose that you want to:

  • Preload a queue or server with entities at the start of the simulation, before you analyze queueing or processing delays.

  • Initialize the capacity of a shared resource before you analyze resource allocation behavior.

In these scenarios, you can simultaneously generate multiple entities at the start of the simulation. You can then observe the behavior of only those entities for the remainder of the simulation.

To generate multiple entities at time 0, use MATLAB® code in the Entity Generator block.

  1. In a new model, from the SimEvents® library, drag the Entity Generator, Entity Terminator, and Dashboard Scope blocks.

  2. Double-click the Entity Generator block.

  3. From the Time source drop-down list, select MATLAB action.

  4. In the Intergeneration time action field, use MATLAB code to enter the number of entities that you want to generate. For example, you could use 8. In that case, at simulation time 0, the Entity Generator block generates 8 simultaneous events.

  5. In the Events action tab, randomize the entity attribute. Select the Generate event action and, in the Generate action field, enter the MATLAB code:

    entity.Attribute1=rand();

The output of the Dashboard Scope block shows that the software generates multiple entities at time 0.

See Also

| | | | | | | | | | | | | | | |

Related Examples

More About

Was this topic helpful?