Page 344 - ExtendSim User Guide
P. 344

318
Tips and Techniques
Event scheduling
tains a current events list. This is a short list of the blocks in the model that need to receive a message before the simulation clock advances.
A prime example of this is the Queue block. When an item arrives to a Queue, a zero time event is posted so that the Queue can return control to the upstream block that sent the item. The Queue receives another message before the clock advances so that an attempt can be made to send the item to the next downstream block. This feature enhances the efficiency and pre- dictability of discrete event models.
Time
0.0 0.0 0.6 1.0
1.2 1.5 1.8 2.0
2.4
Create posts next event time
0.0 0.6 1.2 1.2
1.8 1.8 2.4 2.4
3.0
Activity 1 posts next event time
Infinity 1.0
1.0
2.0
2.0 2.0 2.0 3.0
3.0
Activity 2 posts next event time
Infinity Infinity Infinity 1.5
1.5 Infinity Infinity 2.5
2.5
Events
Item #1 is created
Item #1 begins service at Activity 1 Item #2 is created
Item #1 completes service at Activity 1 Item #1 begins service at Activity 2 Item #2 begins service at Activity 1
Item #3 is created
Item #1 completes service at Activity 2 Item #4 is created
Item #2 completes service at Activity 1 Item #2 begins service at Activity 2 Item #3 begins service at Activity 1
Item #5 is created
Event Scheduling model
A discrete event model is helpful in understanding how event scheduling works. For this example: items arrive, wait at the first queue, are processed at the first activity, wait at the second queue, are processed at the second activity, and leave through an exit.
Event Scheduling model
In this model, there are three blocks that post events:
• TheCreateblockpostsaneventforthecreationofeachitem.Thetimebetweenitemarrivals is 0.6.
• TheActivity1blockpostsaneventfortheearliestcompletiontimeofanitemintheblock. The duration of this activity is 1.0.
• TheActivity2blockpostsaneventfortheearliestcompletiontimeofanitemintheblock. The duration of this activity is 0.5
As the simulation progresses through time, the event calendar in the Executive might look like this:
Notice how the next event time is always the lowest of all of the event times for all the blocks; this is how a discrete event simulation works. Also, the table illustrates the concept of event
Discrete Event


































































































   342   343   344   345   346