Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

Example: Event Calendar Usage for a Queue-Server Model

Overview of Example

To see how the event calendar drives the simulation of a simple event-based model, consider the queue-server model depicted below.

Assume that the blocks are configured so that:

The sections below indicate how the event calendar and the system's states change during the simulation.

Start of Simulation

When the simulation starts, the queue and server are empty. The entity generator schedules an event for T = 0.9. The event calendar looks like the table below.

Time of Event (s)Type of Event
0.9Time-Based Entity Generator block generates an entity.

Generation of First Entity

At T = 0.9,

In the schematic below, the circled notation "e1" depicts the first entity and the dashed arrow is meant to indicate that this entity advances from the entity generator through the queue to the server.

First entity advances to server

The event calendar looks like this.

Time of Event (s)Event Description
1.7Time-Based Entity Generator block generates second entity.
2.2Single Server block completes service on the first entity.

Generation of Second Entity

At T = 1.7,

Second entity advances to queue and waits

Time of Event (s)Event Description
2.2Single Server block completes service on the first entity.
3.8Time-Based Entity Generator block generates the third entity.

Completion of Service Time

At T = 2.2,

First entity completes service and second entity advances from queue to server

Time of Event (s)Event Description
3.8Time-Based Entity Generator block generates the third entity.
4.2Single Server block completes service on the second entity.

Generation of Third Entity

At T = 3.8,

Time of Event (s)Event Description
3.9Time-Based Entity Generator block generates the fourth entity.
4.2Single Server block completes service on the second entity.

Generation of Fourth Entity

At T = 3.9,

Time of Event (s)Event Description
4.2Single Server block completes service on the second entity.
6Time-Based Entity Generator block generates the fifth entity.

Completion of Service Time

At T = 4.2,

Time of Event (s)Event Description
4.9Single Server block completes service on the third entity.
6Time-Based Entity Generator block generates the fifth entity

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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