Lecture 10 and 11 (Event Scheduling)

Lecture 10 and 11 (Event Scheduling) - Tree method o Binary...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CAP 4800/5805 Computer Simulation Concepts Lecture 10 and 11 Structured Event Scheduling In the event scheduling method, a global future event data structure controls the simulation, while individual block elements submit events to occur to the data structure. The “occurrence” of an event means to execute an event routine which handles the semantics associated with that event. Basic cycle for an event scheduling
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The key operations to the data structure o Enqueue: insert a time-tagged event into the data structure so that the structure maintains its ordered sequence o Dequeue: delete the event in the data structure that has the minimum time o Cancel: cancel the event in the data structure with a specified time or event identification Three major categories of data structure: list, tree and table Linear list method: linked list and array
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Tree method o Binary search tree o Heap o Dynamic hashing: see additional note Algorithm for Dynamic Hashing Operation Procedure HashEnqueue(X) Hash to the appropriate bucket using a modulus and a hashing function applied to X Double the hash table size if the number of events is greater than 2 * number of buckets End HashEnqueue Procedure HashDequeue Search all buckets for the event with the minimum time (make sure that time is within the current year) If no events are found for this year (a year of empty buckets), then take the minimum time event Remove the item from the table Halve the hash table size if the number of events is less than 0.5 * number of buckets End HashDequeue Procedure HashCancel(X) Hash to appropriate bucket by applying the hashing function to X Locate X and remove it from the bucket list End HashCancel...
View Full Document

This note was uploaded on 12/09/2009 for the course CAP 5805 taught by Professor Fishwick during the Fall '08 term at University of Florida.

Page1 / 4

Lecture 10 and 11 (Event Scheduling) - Tree method o Binary...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online