Skip to Main Content Skip to Search
Product Documentation

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
0.9FIFO Queue block schedules a NewHeadOfQueue event that indicates arrival of first entity at empty queue.
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
1.7FIFO Queue block schedules a NewHeadOfQueue event.
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.8FIFO Queue block schedules a NewHeadOfQueue event.
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

  


Free SimEvents Evaluation Kit

Learn how you can use SimEvents discrete-event simulation capabilities through these technical resources.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS