Specify Intergeneration Times for Entities

Definition of Intergeneration Time

The intergeneration time is the time interval between successive entities that the block generates. For example, if the block generates entities at T = 50, T = 53, T = 60, and T = 60.1, the corresponding intergeneration times are 3, 7, and 0.1. After each new entity departs, the block determines the intergeneration time that represents the duration until the block generates the next entity.

Approaches for Determining Intergeneration Time

You configure the Time-Based Entity Generator block by indicating criteria that it uses to determine intergeneration times for the entities it creates. You can indicate the criteria by:

  • Specifying a statistical distribution. Upon generating each entity, the block chooses the time interval until the next entity generation. In a simulation that generates a large number of entities, the set of intergeneration times follows the distribution you specify.

  • Providing intergeneration times explicitly as values of a signal. Upon generating each entity, the block reads the value of the input signal. The block uses that value as the time interval until the next entity generation. The signal can be random or nonrandom.

Comparison of Approaches

Using intergeneration times from a distribution might be appropriate if you have a mathematical model of the arrival process for the customers, packets, or other items that entities represent in your model.

Using intergeneration times from a signal might be appropriate if you:

  • Want to use a statistical distribution that is not constant, uniform, or exponential.

  • Want the intergeneration time to depend on the dynamics of other blocks in your model.

  • Have a set of intergeneration times in a MATLAB® workspace variable or in a MAT-file.

How to Specify a Distribution

Specify a Constant, Uniform, or Exponential Distribution

If you want entity intergeneration times to be constant or to follow a uniform or exponential distribution, configure the Time-Based Entity Generator as follows:

  1. Set Generate entities with to Intergeneration time from dialog.

  2. Choose a statistical distribution to describe the time interval between successive entities. Set the Distribution parameter to one of these values:

    • Constant. Then set the Period parameter to the constant intergeneration time.

    • Uniform. Then set the Minimum and Maximum parameters to define the range of possible intergeneration times. The distribution is uniform over this range.

    • Exponential. Then set the Mean parameter to the mean of the exponential distribution. In a simulation with a large number of entities, the average intergeneration time is close to the Mean parameter value.

 Probability density functions and entity generation times

 Role of initial seed for uniform and exponential distributions

Specify Other Probability Distributions

Entity intergeneration times can follow any distribution that the Event-Based Random Number block supports. To specify the distribution, set up your model as follows:

  1. In the Time-Based Entity Generator block, set the Generate entities with parameter to Intergeneration time from port t. A signal input port labeled t appears on the block.

  2. In your model, insert the Event-Based Random Number block. Connect it to the t signal input port of the Time-Based Entity Generator block.

  3. In the Event-Based Random Number block dialog box, set parameters to describe the probability distribution that you want to use for entity intergeneration times. For an example, see Use an Arbitrary Discrete Distribution as Intergeneration Time.

During the simulation, each time that the Time-Based Entity Generator block generates an entity, the Event-Based Random Number block generates a new random number which becomes the duration until the next entity generation.

How to Specify Intergeneration Times from a Signal

If you want to provide intergeneration times explicitly as values of a signal, set up your model as follows:

  1. In the Time-Based Entity Generator block, set the Generate entities with parameter to Intergeneration time from port t. A signal input port labeled t appears on the block.

  2. In your model, create an event-based signal whose value at each generation time is the time until the next entity generation.

     For more information

  3. Connect the signal to the Time-Based Entity Generator block at its signal input port labeled t.

Upon generating each entity, the Time-Based Entity Generator block reads the value of the input signal and uses that value as the time interval until the next entity generation.

    Note:   The block reads the input signal upon each entity generation, not upon each simulation sample time, so signal values that occur between successive entity generation events have no effect on the entity generation process. For example, if the input signal is 10 when the simulation starts, 1 at T=1, and 10 from T=9 until the simulation ends, then the value of 1 never becomes an intergeneration time.

Using Random Intergeneration Times in a Queuing System

Open the model that you created in Build a Discrete-Event Model. Alternatively, in the MATLAB Command Window, enter simeventsdocex('doc_dd1')simeventsdocex('doc_dd1') to open a prebuilt version of the same model.

By examining the Time-Based Entity Generator block Distribution and Period parameters, you can see that the block is configured to use a constant intergeneration time of 1 second. To use a random intergeneration time instead, try the variations in the following table and see how they affect the plot that the simulation creates.

Parameter ValuesSimulation Results
  • Distribution = Uniform

  • Minimum = 1

  • Maximum = 3

The first entity, generated at T=0, appears in the plot at T=1 after its service is complete. The second entity, generated at a random time between T=1 and T=3, appears in the plot between T=2 and T=4.
  • Distribution = Uniform

  • Minimum = 1

  • Maximum = 1.5

The plot might show more entities compared to the preceding scenario because the range of intergeneration times has the same minimum but a smaller maximum.
  • Distribution = Exponential

  • Mean = 0.5

This system is called an M/D/1 queuing system, where the M stands for Markovian and indicates a Poisson arrival rate. The exponential distribution has no upper bound, so the time between successive entities could be any positive number.

Use an Arbitrary Discrete Distribution as Intergeneration Time

This example (open modelmodel) uses the Event-Based Random Number block to generate entities at intervals of 1, 1.5, or 2 seconds.

The Event-Based Random Number block has these parameters:

  • Distribution = Arbitrary discrete

  • Value vector = [1 1.5 2]

  • Probability vector = [0.25 0.5 0.25]

As a result, the block generates intergeneration times Δt such that

P(Δt=1)=0.25P(Δt=1.5)=0.5P(Δt=2)=0.25

When you run the simulation, the plot shows that the entities departing from the server are spaced 1, 1.5, or 2 seconds apart. In this example, however, the simulation time is much too short to verify that the random number generator is applying the specified probabilities.

Use a Step Function as Intergeneration Time

This example (open modelmodel) uses the Step block to generate entities at intervals of 1 or 2 seconds.

The Step block has these parameters:

  • Step time = 2.8

  • Initial value = 1

  • Final value = 2

As a result, the block generates a signal whose value is 1 from T=0 to T=2.8, and whose value is 2 thereafter.

When you run the simulation, the plot shows that the entities departing from the server are initially spaced 1 second apart and later spaced 2 seconds apart.

The Time-Based Entity Generator block reads intergeneration times from the step signal each time it generates an entity. The table below shows when the Time-Based Entity Generator block generates entities and which intergeneration time values it reads in each instance. The table also shows when each entity departs from the server, which you can see from the plot. Although the Step block starts producing the value of 2 at T=2.8, the Time-Based Entity Generator block does not read the new value until the next time it generates an entity, at T=3.

Entity Generation TimeIntergeneration Time Until Next Entity GenerationDeparture Time of Entity from Server
011
112
213
324
526
728
9210

Was this topic helpful?