Example: marketing

Introduction to Discrete-Event Simulation

Introduction to discrete -EventSimulationReference book: " Simulation , modeling & Analysis (3/e) by Law and Kelton, 2000"OutlineSystem, Model, and Simulation System: discrete and Continuous Ways to Study a System Why Model Model Taxonomy Why SimulationDiscrete-Event Simulation What is Discrete-Event Simulation (DES) Example: A Single Server System Advancement of Simulation Time Components and Organization of Discrete-Event Simulation Model Design of Event ListExample: A Single Server System Sample Design for Event-Scheduling Sample Design for Arrival and Departure EThe Stages of a Simulation ProjectSystem: discrete and Continuous System:- a collection of entities that act and interact together towardthe accomplishment of some logical end. discrete system:- state variables change instantaneously at separated point intime, , a bank, since state variables - number ofcustomers, change only when a customer arrives or when acustomer finishes being served and departs Continuous system:- state variable change continuously with respect to time, ,airplane moving through the air, since state variables -position and velocity change continuously with respect totimeWays To Study a SystemSystemExperimentwith actualsystemExperimentwith a model ofactual system- A At-v\^,<1<<WL>Why Model?

Introduction to Discrete-Event Simulation Reference book: "Simulation, Modeling & Analysis (3/e) by Law and Kelton, 2000" Outline System, Model, and Simulation • System: Discrete and Continuous • Ways to Study a System • Why Model • Model Taxonomy • Why Simulation Discrete-Event Simulation • What is Discrete-Event Simulation (DES)

Tags:

  Introduction, Modeling, Simulation, Events, Discrete, And simulation, Discrete event simulation, Simulation discrete event simulation

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Introduction to Discrete-Event Simulation

1 Introduction to discrete -EventSimulationReference book: " Simulation , modeling & Analysis (3/e) by Law and Kelton, 2000"OutlineSystem, Model, and Simulation System: discrete and Continuous Ways to Study a System Why Model Model Taxonomy Why SimulationDiscrete-Event Simulation What is Discrete-Event Simulation (DES) Example: A Single Server System Advancement of Simulation Time Components and Organization of Discrete-Event Simulation Model Design of Event ListExample: A Single Server System Sample Design for Event-Scheduling Sample Design for Arrival and Departure EThe Stages of a Simulation ProjectSystem: discrete and Continuous System:- a collection of entities that act and interact together towardthe accomplishment of some logical end. discrete system:- state variables change instantaneously at separated point intime, , a bank, since state variables - number ofcustomers, change only when a customer arrives or when acustomer finishes being served and departs Continuous system:- state variable change continuously with respect to time, ,airplane moving through the air, since state variables -position and velocity change continuously with respect totimeWays To Study a SystemSystemExperimentwith actualsystemExperimentwith a model ofactual system- A At-v\^,<1<<WL>Why Model?

2 Model:- A representation of the system and study it as a surrogate forthe actual systemWhy Model?- System is not physically exists- Building a system is expensive- Measuring a system is time-consumingCharacterizing a Model- Deterministic or Stochastic Does the model contain stochastic components?- Static or Dynamic Is time a significant variable?- Continuous or discrete Does the system state evolve continuously or only at discretepoints in time? Continuous: classical mechanics discrete : queuing, inventory, machine shop modelsModel Taxonomy/\Monte Carlo Simulation /continuous discretecontinuous discretediscrete-event simulationWhy Simulation ?Many systems are highly complex, precluding thepossibility of analytical solutionThe analytical solutions are extraordinarily complex,requiring vast computing resourcesThus, such systems should be studied by means ofsimulation- numerically exercising the model for inputs in question tosee how they affect the output measures of performance" Simulation is the process of designing a model of a real system andconducting experiments with this model for the purpose either ofunderstanding the behavior of the system or of evaluating variousstrategies (within the limits imposed by a criterion or set of criteria) forthe operation of a system.

3 "-Robert E Shannon 1975 What is Discrete-Event Simulation (DES)A Discrete-Event Simulation - models a system whose state may change only at discrete pointin is composed of objects called entities that have certainproperties called attributesState- a collection of attributes or state variables that represent theentities of the an instantaneous occurrence in time that may alter the state ofthe systemAn event initiates an activity, which is the length of timeduring which entities engage in some operationsEntities, attributes, events , activities and theinterrelationships between these components are definedin the model of the systemExample: A Single Server System Entities: customers; server Attributes of a customer: service required Attributes of server: server's skill (its service rate) events : arrival of a customer; departure of acustomer Activities: serving a customer, waiting for a newcustomerQueue ServerCustomer Arrival-Customer DepartureWhat is Discrete-Event Simulation (DES)

4 Discrete-Event Simulation is stochastic, dynamic, anddiscreteStochastic = Probabilistic- Inter-arrival times and service times are random variables- Have cumulative distribution functionsDiscrete = Instantaneous events are separated by intervalsof time- The state variables change instantaneously at separate points in time The system can change at only a countable number of points in These points in time are the ones at which an event = Changes overtime- Simulation clock Keep track of the current value of simulated time as the Simulation proceeds- A mechanism to advance simulated time from one value to another Next-event time advanceAdvancement of Simulation Time Fundamental to every Simulation study is amechanism to model the passage of time Every model contains a variable called the internalclock, or the Simulation clock Time may be modeled in a variety of ways withinthe Simulation How do we advance simulated time?

5 - Time as linked events (Next-event time advance)- Time divided into equal increments (Fixed-increment timeadvance)Advancement of Simulation Time Time as linked events (Next-event time advance)- All state changes occur only at event times for a Discrete-Event Simulation model- Periods of inactivity are skipped over by jumping the clockfrom event time to event time- This method is called event-driven DES and is asynchronousas opposed to time-stepped approach which is synchronous Time divided into equal increments (Fixed-increment time advance)|stl|st2|st3|st4|-|Stw|Component s and Organization of Discrete-Event Simulation ModelInitialization Routinei. set Simulation ciock=02. Initialize system stateand statistical counters3. Initialize event listDefinitions are inthe next two slidesMain Program0. Invoke the initialization routine1. Invoke the timing routine2. Invoke event routine i ^Repeatedly1.

6 Determine the nextevent type, say, I2. Advance thesimulation clockEvent routine i XLibrary routines1. Update system state2. Update statistical counters3. Generate future events and add toevent listGenerate randomvariables4 *^re simulations,^^s. over? ^^~Report generator X1. Compute estimates of Interest2. Write reportComponents and Organization of Discrete-Event Simulation Model System state- The collection of state variables necessary to described thesystem at a particular time Simulation clock- A variable giving the current value of simulated time Event list- A list containing the next time when each type of event willoccur Statistical counters- Variables used for storing statistical information about systeminformation Initialization routine- A subprogram to initialize the Simulation model at time 0 Timing routine- A subprogram that determines the next event from the event listand then advances the Simulation clock to the time when thatevent is to occurComponents and Organization of Discrete-Event Simulation Model R e p o r t g e n e r a t o r- A subprogram that computes estimates (from the statistical counters)

7 Ofthe desired measures of performance and produces a report when thesimulation ends E v e n t r o u t i n e- A subprogram that updates the system state when a particular type ofevent occur There is one event routine for each event type L i b r a r y r o u t i n e s- A set of subprogram used to generate random observations fromprobability distributions that were determined as part of the simulationmodel Main program- A subprogram that invokes the timing routine determine the next event and- transfer control to the corresponding event routine update the system state appropriately- check for termination invoke the report generator when the Simulation is of Event ListEvents are chronologically ordered in List- sometimes called the pending event set because it listsevents that are contains all scheduled events , arranged in chronologicaltime In the simulator, this is just a data structure, list, treeE t 0 < E t 1 < E t 3 < < E t nf f l ^ - JCurrent Time for En generates a new event Et1,Time Next Event which is placed at the appropriateposition in the event list using timetfExample: A Single Server System Entities: customers; server Attributes of a customer: service required Attributes of server: server's skill (its service rate) events : arrival of a customer; departure of acustomer Activities: serving a customer, waiting for a newcustomerQueue ServerCustomer Arrival-Customer DepartureSample Design for Event-SchedulingMain (executive routine):1.

8 Set clock = 02. set cumulative statistics to 03. define initial system state (queue empty, server idle)4. generate the occurrence time of the first arrival and place in eventlist5. select the next event on event list (arrival or departure event)6. advance Simulation clock to time of next event7. process this event (execute the corresponding event routine)8. if not end-of- Simulation , goto step 5 Sample Design for Arrival and DepartureEvent RoutineArrivalEventSchedule the nextarrival eventYe s/rathe serveN^V. b u s y ? ^ ^No1'"Add 1 to thenumber In queueMake the severbusy1 Schedule adeparture eventfor this customertCollect statisticsYe sMake the serverIdlef R e t u r n JSubtract 1 fromthe number inqueueSchedule adeparture eventfor this customerCollect statisticsC R e t u r n )The Stages of a Simulation ProjectPlanning- Problem Formulation: what is it and what do I want to do withit?

9 - Resource Estimation: time, people and System and Data AnalysisModeling- Model Building: find Data Acquisition: find and collect appropriate Model Translation: program and and Validation- Verification: does the PROGRAM execute as intended?- Validation: does the PROGRAM represent reality asintended?Typically an iterative processConclusionIt is not so hard to write a Simulation programEfficiency is critical point to a Simulation programReferenceSimulation, modeling & Analysis (3/e) by Law andKelton, ~esmirni/Teaching/cs526 ~.


Related search queries