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

Intergeneration TimesValue of Generate entities with Parameter
Distributed according to various parameters in the block's 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 Introduction to the Time-Based Entity Generator.

Responding to Blockage at the Entity Output Port

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.

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

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
peA 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 cases1
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 type

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

Response when blocked, Response when unblocked

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.

Entity Generation Tab

Generate entities with

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

Distribution

The statistical distribution of intergeneration times. This field appears only if you set Generate entities with to Intergeneration time from dialog.

Period

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.

Initial seed

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.

Minimum, Maximum

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.

Mean

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.

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.

Statistics Tab

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.

Number of entities departed

Controls the presence and behavior of the signal output port labeled #d.

Status of pending entity departure

Controls the presence and behavior of the signal output port labeled pe.

Average intergeneration time

Controls the presence and behavior of 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, 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
1Entity 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.
2Entity generator generates the second entity and holds it because the OUT port is blocked.
2.5First 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.5Entity generator generates the third entity, and holds it because the OUT port is blocked.
4.7Second 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
1Entity 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.
2Entity generator generates the second entity and holds it because the OUT port is blocked.
2.5First 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.5The 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.5Entity generator generates the third entity, and holds it because the OUT port is blocked.
5.7Second 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.7The 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.

See Also

Event-Based Entity Generator, Entity Sink

Creating Entities Using Intergeneration Times

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS