NET 4001/ITEC 5113 Network Simulation Introduction to Simulation © Marc St-Hilaire Overview • What is simulation? • Why/why not use simulation? • Advantages/disadvantages • Definition of system and its components • What is a model? • Categorization of models • Different steps • Simulation software • Readings 2 What is simulation? Definitions 1) “Imitation of the operation of a real-world process or system over time.” (Banks et al.) 2) “Process of designing a model of a real system and conducting experiments for the purpose of understanding the behavior of the system.” (Shannon, 1975) – – – – Done by hand or computer Involves generation of artificial history to draw conclusion Used to investigate different “What if” scenarios Can be used with existing (effect of change) and new systems (predict performance) – In contrast to optimization models, simulation models are “run” rather than “solved”. Simulation vs Emulation vs Real system 3 Why use simulation? • Study and/or experiment the internal interaction of complex systems • Different changes can be simulated • Give insight for improvement in the system under investigation • See how the system reacts to different inputs • Verify and give strength to analytic solutions • Can be used for training new employee – CAE (mainly known for their flight simulators): http://www.cae.com • Video of where simulation is going in the military (Live, Virtual, and Constructive LVC) • Video talking about a massive Simulation Training Centre in Brunei 4 Do NOT use simulation if: • • • • • • • The problem can be solved by common sense The problem can be solved analytically It is easier to solve the problem by direct experimentations Simulation cost > savings Resources and/or time are not available No data is available Verification and validation can't be performed – Verification: Building the model correctly – Validation: Building the correct model to capture the desired characteristics • System behavior is too complex or can’t be defined (e.g., some human behavior) 5 Advantages vs. disadvantages of simulation Advantages – Money $$ – Level of details – Different scenarios can be evaluated – Insight can be obtained from the interaction of variables Disadvantages – Need of special training – Errors (manipulation, model and so on) – Simulators are not always perfect – It is simulation… 6 What is a system? When we perform a simulation, it’s because we want to simulate a system. System: Group of objects that are joined together (relationships/interactions) in order to accomplish some purposes. System environment: A system can be affected by changes occurring outside the system. These changes are said to occur in the system environment. It is important to decide where to place the boundary between the system and its environment. This decision may depend on the purpose of the simulation. 7 System vs. boundary In this example, the arrival of orders is outside the system boundary and therefore considered as a constraint. System boundary System (eg. Factory) Environment (eg. arrival of orders) Figure 1: System vs. boundary However, in some other cases (e.g., study the effect of supply on demand), it can be considered as part of the system. 8 Components of a system Entity: Object of interest Attribute: Property of an entity Activity: Time period of specified length State: Collection of variables representing the system at any given time Event: occurrence that might change the system state – Endogenous: event occurring inside the system – Exogenous: event occurring in the environment of the system 9 Examples 1) Banking System: • • • • • Entities: Customers Attributes: Check account balance Activities: Making deposit Events: Arrivals and departures State variables: Number of busy tellers, number of customers waiting, etc. 2) Communication System: • • • • • Entities: Messages (or packets) Attributes: Length, destination Activities: Transmitting Events: Arrivals State variables: Number of messages waiting to be transmitted, etc. 10 Model To study a system, we can: 1) Experiment with the system itself (not always possible!) 2) Develop a model What is a model? • Representation (simplification) of a real-world system • Generally composed of assumptions (mathematical, logical, etc.) • Some models are impossible to solve mathematically…that’s why we need simulation 11 Categorization of models • • Discrete Systems – State variables change only at discrete set of points in time. – Example: Number of customers in a bank. Continuous Systems – State variables change continuously in time. – Example: water level behind a dam (in meter). 3 Continuous Discrete 2 1 0 Time Figure 2: Discrete vs. Continuous 12 Categorization of models • Stochastic/Deterministic: A deterministic model has no random variables (known input). Stochastic models have random variables. • Static/Dynamic: In a static model, time is not a significant variable (static is like a picture of the system at a given time). • Continuous/Discrete: In continuous system, state variables evolve continuously. Model Stochastic Static Deterministic Dynamic Continuous Static Discrete Dynamic Continuous Discrete Discrete-Event Simulation 13 Steps in a simulation study* Alternatives 1) Discovery or orientation 3) Running of the model Performance analysis Computer program 4) Implementation Are you building it right? Calibration Are you building the right thing? 2) Model building 14 *Discrete Event Simulation Systems, 4th edition, Banks et al. Simulation software A lot of software have been developed to do simulation: • Network simulators, computer networks and communications – – – – Packet Tracer Riverbed/OPNET NS-2, NS-3 OMNET++, GTnetS and so on… • General simulators for real life situations – Arena (business processes), QUEST (labor, fluids, automated storage), ProModel (manufacturing systems), and the list goes on… Also possible to run simulation with standard programming languages such as Java, C/C++, python, etc. However, all details must be programmed… 15 Readings • Chapter 1 from Discrete Event System Simulation, 5th Edition, Banks et al. (Mandatory) • Chapter 4 (Simulation Software) from Discrete Event System Simulation, 5th Edition, Banks et al. (Optional) 16