Documentation Center

  • Trials
  • Product Updates

Time-Based Entity Generator

Generate entities using intergeneration times from signal or statistical distribution

Library

Generators / Entity Generators

Description

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 generation events.

Intergeneration TimesValue of Generate entities upon Parameter
Distributed according to various parameters in the block dialog boxIntergeneration time from dialog
Specified using an input signal that the block reads at the start of the simulation and each time it generates an entityIntergeneration time from port t

For details about these options, see Specify Intergeneration Times for Entities.

Responding to Blockage at the Entity Output Port

You can choose how this block responds when it generates an entity that the subsequent entity input port is not available to accept:

  • If you set Response when blocked to Error, the simulation halts with an error message.

  • If you set Response when blocked to Pause generation, this block holds the entity, which becomes a pending entity. The block does not schedule another entity generation event yet. The Response when unblocked parameter determines what the block does next:

    • If you set Response when unblocked to Immediate restart, after this block learns that the subsequent port is available, the pending entity departs. After the pending entity departs, this block schedules the generation of the next entity.

    • If you set Response when unblocked to Delayed restart, upon learning that the subsequent port is available, this block schedules an event of type DelayedRestart. The event time is the current time plus the same intergeneration time the block used when generating the pending entity. When the block executes the event, the pending entity attempts to depart.

Use the Delayed restart option if you want to:

  • Keep the arrival process memoryless, when Distribution is Exponential.

  • Prevent correlation among multiple instances of this block if they become unblocked simultaneously.

For an example, see Example: Responding to Blockage.

Ports

Signal Input Ports

LabelDescription
tTime interval between generation events of the current entity and the next entity. The block reads the value after the current entity departs and the block updats 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 signal must be an event-based signal. You see this port only if you set Generate entities upon to Intergeneration time from port t.

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 of the pending entity.

1
wAverage 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 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

Determines where the block gets instructions about when to generate entities.

Distribution

The statistical distribution of intergeneration times. You see this field only if you set Generate entities upon to Intergeneration time from dialog.

Period

The time interval between entity generations, in seconds. You see this field only if you set Generate entities upon to Intergeneration time from dialog and set Distribution to Constant.

Initial seed

A nonnegative integer that initializes the random number generator. You see this field only if you set Generate entities upon to Intergeneration time from dialog and set Distribution to Uniform or Exponential.

Minimum

The lower endpoint, in seconds, of the interval over which the distribution is uniform. This field appears only if you set Generate entities upon to Intergeneration time from dialog and set Distribution to Uniform.

Maximum

The upper endpoint, in seconds, of the interval over which the distribution is uniform. This field appears only if you set Generate entities upon to Intergeneration time from dialog and set Distribution to Uniform.

Mean

The expected value of the exponential distribution. You see this field only if you set Generate entities upon to Intergeneration time from dialog and set Distribution to Exponential.

Generation event priority

The priority of the entity-generation event, relative to other simultaneous events in the simulation.

Generate entity at simulation start

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.

Blocking Tab

Response when blocked

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.

Response when unblocked

Determines entity generation behavior if the entity input port of the subsequent block is available again after a prior blockage; see Responding to Blockage at the Entity Output Port.

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.

Examples

Example: Responding to Blockage

To illustrate the blockage options, consider a Time-Based Entity Generator block followed by a Single Server block, then followed by an Entity Sink block.

Suppose the block configurations have these characteristics:

  • The entity generator has Response when blocked set to Pause generation.

  • The entity generator generates the first entity at T=1 and uses an intergeneration time of 1 s.

  • The service times for the first three entities in the server are 1.5, 2.2, and 1.8.

The following tables indicate how the Response when unblocked values affect the behavior in the simulation.

Immediate Restart

Time (s)Behavior
1Entity generator generates and outputs the first entity to the server. The entity input port of the server becomes unavailable. The first entity is in service until T=1+1.5=2.5.
2Entity generator generates the second entity and holds it because the OUT port is blocked.
2.5First entity departs from the server. The entity input port of the server becomes available and the second entity advances from the entity generator to the server. The entity input port of the server then becomes unavailable. The second entity is in service until T=2.5+2.2=4.7. The entity generator schedules the next generation for T=2.5+1=3.5.
3.5Entity generator generates the third entity, and holds it because the OUT port is blocked.
4.7Second entity departs from the server. The entity input port of the server becomes available and the third entity advances from the entity generator to the server. The entity input port of the server then becomes unavailable. The third entity is in service until 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
1Entity generator generates the first entity. The entity advances to the server. The entity input port of the server becomes unavailable. The entity is in service until T=1+1.5=2.5.
2Entity generator generates the second entity. The entity becomes a pending entity because the OUT port is blocked.
2.5First entity departs from the server. The entity input port of the server becomes available. The entity generator schedules a delayed restart event for the second entity at T=2.5+1=3.5.
3.5The second entity advances from the entity generator to the server. The entity input port of the server then becomes unavailable. The second entity is in service until T=3.5+2.2=5.7. The entity generator schedules the next generation for T=3.5+1=4.5.
4.5Entity generator generates the third entity. The entity becomes a pending entity because the OUT port is blocked.
5.7Second entity departs from the server. The entity input port of the server becomes available. The entity generator schedules a delayed restart event for the third entity at T=5.7+1=6.7.
6.7The third entity advances from the entity generator to the server. The entity input port of the server then becomes unavailable. The third entity is in service until T=6.7+1.8=8.5. The entity generator schedules the next generation for T=6.7+1=7.7.

Was this topic helpful?