In addition to time-based entity generation, the Entity Generator block enables you to generate entities in response to events that occur during the simulation. In event-based generation, a new entity is generated whenever a message arrives at the input port of the Entity Generator block.
Event times and the time intervals between pairs of successive entities are not necessarily predictable in advance.
Generating entities when events occur is appropriate if you want the dynamics of your model to determine when to generate entities.
To generate an entity when the first entity is destroyed, use two Entity Generator blocks and a Simulink Function block. The Entity Terminator block calls the Simulink Function after destroying the first entity.
To open the example, see Event-Based Entity Generation
.
In this example, Entity Generator1 generates
the first entity. SendMessage contains the genNext
function,
which sends a message.
The Entity Terminator block calls the genNext
function.
For an example that uses an Excel® spreadsheet, see Generating
and Initializing Entities
.
Composite Entity Splitter | Discrete Event Chart | Entity Gate | Entity Generator | Entity Input Switch | Entity Multicast | Entity Output Switch | Entity Queue | Entity Replicator | Entity Server | Entity Terminator | MATLAB Discrete Event System | Multicast Receive Queue