Documentation

Event-Based Entity Generator

Generate entity upon signal-based event or function call

Library

Generators / Entity Generators

Description

This block is designed to generate entities when events of a specified type occur.

When to Generate EntitiesGenerate entities upon Value
Each time the application updates (that is, recomputes and outputs) the value of a signalSample time hit from port ts
Each time an input signal has a trigger edgeTrigger from port tr
Each time an input signal changes its valueChange in signal from port vc
Each time an input signal carries a function callFunction call from port fcn

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 BlockageParameter Values
Error messageClear 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

Ports

Signal Input Ports

LabelDescription
tsWhen 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.
trWhen 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.
vcWhen 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.
fcnWhen 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

LabelDescription
OUTPort through which generated entities depart.

Signal Output Ports

LabelDescriptionTime of Update When Statistic Is OnOrder of Update
#dNumber of entities that have departed from this block since the start of the simulation.After entity departure3
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
wAverage 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 departure2

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.

Dialog Box

Entity Generation Tab

Generate entities upon

The type of event that indicates when the block can generate an entity.

Trigger type, Type of change in signal value

Trigger type 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.

Type of change in signal value 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.

Specify event priority for entity generation

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 Resolve Simultaneous Signal Updates.

Generation event priority

The priority of the entity-generation event, relative to other simultaneous events in the simulation. For details, see Specify Event Priorities to Resolve Simultaneous Signal Updates. You see this field only if you select Resolve simultaneous signal updates according to event priority.

Allow entity generation upon sample time hit (or function call) at simulation start time

If you select Allow entity generation upon sample time hit at simulation start time, 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 Allow entity generation upon function call at simulation start time, 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.

Blocking Tab

Allow OUT port blocking

If you do not select this option and a generated entity cannot depart immediately, the simulation halts with an error message.

Response during blockage period

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.

Entity Type Tab

Entity type

The blank type includes no attributes. The standard type includes attributes called Priority and Count with default values of 10 and 0, respectively.

Statistics Tab

These parameters determine whether the block produces data at signal output ports or omits those ports.

Number of entities departed

Allows you to use the signal output port labeled #d.

Pending entity present in block

Allows you to use the signal output port labeled pe.

Average intergeneration time

Allows you to use the signal output port labeled w.

Was this topic helpful?