Unformatted text preview:

Simulation ImplementationImplementation of a Single- Server Queuing SystemSnapshot or System ImageGenerating Future EventsSlide 5DATA StructuresQueueFuture Events ListSlide 9Generating ArrivalsGenerating Departures Complete ServiceGenerating EventsWhat? Me Simulate?Generation of EventsMAINARRIVEDEPARTENTER-SERVICEENTER-QUEUEREMOVE-FROM-QUEUESTATSSNAPSHOTOUTPUTPROJECT #11Simulation ImplementationUsing high-level languages2Implementation of a Single- Server Queuing SystemTwo Main EntitiesSERVER: Busy= 0/1QUEUE: Qsize= #Two Critical Events – for customersArrivalComplete Service (Depart)How do these entities interact?Initialization?How are each of the variables affected?How should simulation terminate?3Snapshot or System ImageState of the system at a given timeState variablesQueueFuture Events List (FEL)4Generating Future EventsBootstrapping: a method for generating an arrival stream on an “as you go” basisAs opposed to generating all events at oncea.k.a. on-the-fly5Generating Future EventsProcess1. Generate initial arrival; when it is removed from FEL generate new interarrival time - add to clock for arrival time- place next arrival on FEL2. When item is placed in service, generate service time - add to clock – place completion event on FEL6DATA StructuresFuture Events List (FEL)Queue (1 or more)What information is required for each one?What information is not required but might be convenient?When and how are insertions & deletions made?When are various units of information generated (calculated)?7QueueStandard FIFOCustomer identificationTime entered queueArrival timeType of service being requested (if more than one)8Future Events ListArray implementationEach row represents a specific eventCustomer ID (identification number)Time of occurrenceSearch for smallest time to get the “next event”9Future Events ListLinked List ordered by time of occurrenceEvent TypeTime of OccurrenceIdentification of customer10Generating Arrivals Initialize at a fixed time or time zeroOne for each type of arrival Subsequent arrivals are generated as arrival is removedRemove arrival- generate IAT- add to current time (clock) - put on FELAt any time, there should only be one arrival of any given type11Generating Departures Complete ServiceGenerated when customer enters the service that will cause the departureNot necessarily upon arrival, not if enter queue, only when enter serviceEnter service (from queue or from arrival) - generate service time - add to current time (clock) - put on FEL12Generating EventsTerminate EventOnly one: placed on FEL at initializationSnapshot Event (Status Report)Initialize 1st oneRemove from FEL- add time unit - return to FEL13What? Me Simulate?Paper by Dr. Halverson14Generation of EventsInitialization of FELOne arrival (of each type)SnapshotStop eventGeneration of ArrivalWhen removed from FEL, generate next arrival15MAINInitialize FEL, statistical variables, clockRemove next-event from FELWhile not stop-eventClock = next-event.timeCase next-event of Arrival: produce next arrival call ARRIVEDeparture: call DEPARTSnapshop: call SNAPSHOTRemove next-event from FELStop-simulation: call STATS; call OUTPUT16ARRIVEIf server_status = busyThen call ENTER-QUEUEElse call ENTER-SERVICE17DEPARTIf queue = emptyThen server_status= freeElse call REMOVE-FROM-QUEUE18ENTER-SERVICEserver_status = busyGenerate departure eventUpdate service stats19ENTER-QUEUEAdd customer to queueUpdate queue statistics20REMOVE-FROM-QUEUEUpdate queue and statisticsCall ENTER-SERVICE21STATSCompute final averages, totals, etc.IAT, Service time, UtilizationQueue length, max, min, averageNumber arrivals, departuresWait time, Time in systemSNAPSHOTGenerate next Snapshot event, place in FELPrint State variablesPrint QueuePrint FEL2223OUTPUTPrint resultsPROJECT #1Must follow the guidelines presented in class for the form of your program. Must use object oriented approachPrint out of Code due in 1


View Full Document

MSU CMPS 4223 - Simulation Implementation

Documents in this Course
Load more
Download Simulation Implementation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Simulation Implementation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Simulation Implementation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?