| Contents | Index |
Generators / Entity Generators
This block is designed to generate entities when events of a specified type occur.
| When to Generate Entities | Generate entities upon Value |
|---|---|
| Each time the application updates (that is, recomputes and outputs) the value of a signal | Sample time hit from port ts |
| Each time an input signal has a trigger edge | Trigger from port tr |
| Each time an input signal changes its value | Change in signal from port vc |
| Each time an input signal carries a function call | Function call from port fcn |
Note An exceptional case is when the block temporarily suspends its normal entity-generation behavior. See the description of the Delay first pending entity option in Responding to Blockage at the Entity Output Port. |
You can choose how this block responds when the subsequent entity input port is not available to accept the newly generated entity. The responses and corresponding parameters values are in the table.
| Response to Blockage | Parameter Values |
|---|---|
| Error message | Clear the Allow OUT port blocking check box. |
| The block stores the entity as a pending entity, and immediately discards it. The entity does not depart from the block. | Select Allow OUT port blocking and set Response during blockage period to Discard generated entities |
| The block stores the entity as a pending entity, and temporarily suspends the generation of additional entities. During this suspension, when the block executes EntityGeneration events, it does not produce new entities. When the subsequent entity input port becomes available, the pending entity departs and the block resumes normal operation. | Select Allow OUT port blocking and set Response during blockage period to Delay first pending entity |
Signal Input Ports
| Label | Description |
|---|---|
| ts | When this signal has an update, the block generates an entity. This signal must be an event-based signal. You see this port only if you set Generate entities upon to Sample time hit from port ts. |
| tr | When this signal satisfies the specified trigger criteria, the block generates an entity. This signal must be an event-based signal. You see this port only if you set Generate entities upon to Trigger from port tr. |
| vc | When this signal satisfies the specified value-change criteria, the block generates an entity. This signal must be an event-based signal. You see this port only if you set Generate entities upon to Change in signal from port vc. |
| fcn | When this signal carries a function call, the block generates an entity. This signal must be an event-based function call. You see this port only if you set Generate entities upon to Function call from port fcn. |
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 that the block stores an entity that has tried and failed to depart. In that case, the entity is a pending entity. A value of 0 indicates that the block does not store any pending entities. | Sample time hit of 1 occurs after the block stores an entity that has tried and failed to depart. Sample time hit of 0 occurs after the departure or discarding of the pending entity. | 1 |
| w | Average intergeneration 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 type of event that indicates when the block can generate an entity.
Determines whether rising, falling, or either type of trigger edge causes an entity generation. You see this field only if you set Generate entities upon to Trigger from port tr.
Determines whether rising, falling, or either type of value change causes an entity generation. You see this field only if you set Generate entities upon to Change in signal from port vc.
Select this option to prioritize the entity-generation event explicitly, relative to other simultaneous events in the simulation. If you do not select this option, the event has priority SYS1 on the event calendar. For details, see Choosing How to Resolve Simultaneous Signal Updates.
The priority of the entity-generation event, relative to other simultaneous events in the simulation. For details, see Specifying Event Priorities to Resolve Simultaneous Signal Updates. You see this field only if you select Resolve simultaneous signal updates according to event priority.
If you select this option, the block generates the first entity when the simulation begins. Otherwise, the block generates the first entity upon the first update of the ts signal at a nonzero value of time. You see this field only if you set Generate entities to Sample time hit from port ts.
If you select this option, the block responds to function calls at the starting time of the simulation. Otherwise, the block responds only to function calls at subsequent times. You see this field only if you set Generate entities upon to Function call from port fcn.

If you do not select this option and a generated entity cannot depart immediately, the simulation halts with an error message.
Determines how the block responds if a generated entity cannot depart immediately; see Responding to Blockage at the Entity Output Port. You see this field only if you select Allow OUT port blocking.

The blank type includes no attributes. The standard type includes attributes called Priority and Count with default values of 10 and 0, respectively.
These parameters determine whether the block produces data at signal output ports or omits those ports. For descriptions of the data and ports, see the preceding table, "Signal Output Ports".

Allows you to use the signal output port labeled #d.
Allows you to use the signal output port labeled pe.
Allows you to use the signal output port labeled w.
Time-Based Entity Generator, Entity Sink
Generating Entities When Events Occur

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |