| SimEvents® | ![]() |
Generate entities using intergeneration times from signal or statistical distribution
Generators / Entity Generators
This block is designed to generate entities using intergeneration times that satisfy criteria that you specify. The intergeneration time is the time interval between two successive entities' generation events.
| Intergeneration Times | Value of Generate entities with Parameter |
|---|---|
| Distributed according to various parameters in the block's dialog box | Intergeneration time from dialog |
| Specified using an input signal that the block reads at the start of the simulation and each time it generates an entity | Intergeneration time from port t |
For details about these options, see Introduction to the Time-Based Entity Generator.
You can choose how this block responds when it generates an entity that the subsequent input port is not available to accept. If applicable, you can also choose how the block responds when that port later becomes available.
If you set Response when blocked to Error, then the simulation halts with an error message if the subsequent entity input port is not available to accept an entity when this block generates it.
If you set Response when blocked to Pause generation, then this block holds the generated entity and temporarily suspends the generation of additional entities. The Response when unblocked parameter determines when the held entity departs.
If you set Response when unblocked to Immediate restart, then the held entity departs after this block receives notification that the subsequent entity input port has become available. After the held entity departs, this block schedules the generation of the next entity.
If you set Response when unblocked to Delayed restart, then upon receiving notification that the subsequent entity input port has become available, this block schedules an extra generation event for the held entity. The event time is the current time plus the same intergeneration time used when first generating the held entity. When the extra generation event is processed, the held entity attempts to depart.
For an example, see Example: Responding to Blockage.
Signal Input Ports
| Label | Description |
|---|---|
| t | Time interval between generation events of the current entity and the next entity. The block reads the value after the current entity has departed and the block has updated its output signals, if any. If you do not select Generate entity at simulation start, then the block also reads the value of this signal at the start of the simulation. This port appears only if you set Generate entities with to Intergeneration time from port t. |
Entity Output Ports
| Label | Description |
|---|---|
| OUT | Port through which generated entities depart. |
Signal Output Ports
| Label | Description | Time of Update When Statistic Is On | Order of Update |
|---|---|---|---|
| #d | Number of entities that have departed from this block since the start of the simulation. | After entity departure | 3 |
| pe | A value of 1 indicates when the block is holding an entity that cannot depart because the subsequent entity input port is unavailable or because of a delayed restart of this block. | After entity generation if OUT port is blocked, and when entity departure is imminent in all cases | 1 |
| w | Average interdeparture time, in seconds, for all pairs of successive entities that have departed from this block. The signal value is 0 before the second entity departure. | After entity departure | 2 |
The initial output value, which is in effect from the start of the simulation until the first update by the block, is 0 for all signals.

The blank type includes no attributes. The standard type includes attributes called Priority and Count with default values of 10 and 0, respectively.
Determines how the block responds if a generated entity cannot depart immediately because the entity input port of the subsequent block is unavailable; see Responding to Blockage at the Entity Output Port.

Determines where the block gets instructions about when to generate entities.
The statistical distribution of intergeneration times. This field appears only if you set Generate entities with to Intergeneration time from dialog.
The time interval between entity generations, in seconds. This field appears only if you set Generate entities with to Intergeneration time from dialog and set Distribution to Constant.
A nonnegative integer that initializes the random number generator. This field appears only if you set Generate entities with to Intergeneration time from dialog and set Distribution to Uniform or Exponential.
The endpoints, in seconds, of the interval over which the distribution is uniform. These fields appear only if you set Generate entities with to Intergeneration time from dialog and set Distribution to Uniform.
The expected value of the exponential distribution. This field appears only if you set Generate entities with to Intergeneration time from dialog and set Distribution to Exponential.
The priority of the entity-generation event, relative to other simultaneous events in the simulation.
If you select this option, the block generates the first entity when the simulation begins and the second entity at the first intergeneration time. Otherwise, the block generates the first entity at the first intergeneration time.
These parameters determine whether certain ports produce data throughout the simulation, produce data only when you stop or pause the simulation, or are omitted from the block. For descriptions of the affected ports, see the "Signal Output Ports" table above.

Controls the presence and behavior of the signal output port labeled #d.
Controls the presence and behavior of the signal output port labeled pe.
Controls the presence and behavior of the signal output port labeled w.
Example: Using Random Intergeneration Times in a Queuing System
Example: Using an Arbitrary Discrete Distribution as Intergeneration Time
To illustrate the blockage options, consider a Time-Based Entity Generator block followed by a Single Server block, followed by an Entity Sink block.

Suppose the entity generator has Response when blocked set to Pause generation. Also, suppose that the intergeneration time is 1 with the first entity generated at T=1, and that the service times for the first three entities in the server are 1.5, 2.2, and 1.8. The tables below indicate how the Response when unblocked values affect the behavior in the simulation.
Immediate Restart
| Time (s) | Behavior |
|---|---|
| 1 | Entity generator generates and outputs the first entity to the server. The server's entity input port becomes unavailable. The first entity is scheduled to depart from the server at T=1+1.5=2.5. |
| 2 | Entity generator generates the second entity and holds it because the OUT port is blocked. |
| 2.5 | First entity departs from the server. The server's entity input port becomes available and the second entity advances from the entity generator to the server. The server's entity input port becomes unavailable again. The second entity is scheduled to complete service at T=2.5+2.2=4.7. The entity generator schedules the next generation for T=2.5+1=3.5. |
| 3.5 | Entity generator generates the third entity, and holds it because the OUT port is blocked. |
| 4.7 | Second entity departs from the server. The server's entity input port becomes available and the third entity advances from the entity generator to the server. The server's entity input port becomes unavailable again. The third entity is scheduled to complete service at T=4.7+1.8=6.5. The entity generator schedules the next generation for T=4.7+1=5.7. |
Delayed Restart
| Time (s) | Behavior |
|---|---|
| 1 | Entity generator generates and outputs the first entity to the server. The server's entity input port becomes unavailable. The first entity is scheduled to depart from the server at T=1+1.5=2.5. |
| 2 | Entity generator generates the second entity and holds it because the OUT port is blocked. |
| 2.5 | First entity departs from the server. The server's entity input port becomes available. The entity generator schedules an extra generation event for the second entity at T=2.5+1=3.5. |
| 3.5 | The second entity advances from the entity generator to the server. The server's entity input port becomes unavailable again. The second entity is scheduled to complete service at T=3.5+2.2=5.7. The entity generator schedules the next generation for T=3.5+1=4.5. |
| 4.5 | Entity generator generates the third entity, and holds it because the OUT port is blocked. |
| 5.7 | Second entity departs from the server. The server's entity input port becomes available. The entity generator schedules an extra generation event for the third entity at T=5.7+1=6.7. |
| 6.7 | The third entity advances from the entity generator to the server. The server's entity input port becomes unavailable again. The third entity is scheduled to complete service at T=6.7+1.8=8.5. The entity generator schedules the next generation for T=6.7+1=7.7. |
Event-Based Entity Generator, Entity Sink
Creating Entities Using Intergeneration Times
![]() | Subsystem Configuration | X-Y Attribute Scope | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |