Fall Term 2006 COMP 522 Modelling and Simulation “model everything” Hans Vangheluwe Modelling, Simulation and Design Lab (MSDL) School of Computer Science, McGill University, Montr´ eal, Canada Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 1/37
Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 2/37
A Variety of Complex Systems . . . Need to be modelled • at most appropriate level of abstraction • in most appropriate formalism(s) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 3/37
Available Information, Questions to be Answered, . . . ⇒ choice of Abstraction Level/Formalism Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 4/37
Power Window Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 5/37
Power Window: need for multiple formalisms http://www.mathworks.com/products/demos/simulink/PowerWindow/html/PowerWindow1.html Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 6/37
COMP 522A: Modelling and Simulation • . . . to study (static/dynamic) structure and (dynamic) behaviour • . . . for analysis and design of complex systems • . . . for different application domains : computer networks, software design, traffic control, software engineering, biology, physics, chemistry, management, . . . • . . . implemented using Computer Science • . . . focus on Software Engineering Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 7/37
Overview 1. What is Modelling and Simulation ? 2. Which topics does COMP 522 cover ? 3. What are the pre-requisites ? 4. How is evaluation done ? 5. What are the assignments about ? 6. Where do I get the material covered in CS522 ? Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 8/37
What is Modelling and Simulation ? • Modelling : represent/re-use/exchange knowledge about system structure and behaviour • Simulation : to accurately and efficiently emulate real behaviour • Why ? – cost, danger, . . . – what-if analysis ? – optimization (do it right the first time) ! ⇒ modelling and simulation based design Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 9/37
Modelling and Simulation Based Design Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 10/37
M&S in action: Flight Simulation www.flightgear.org Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 11/37
M&S in action: Environment NATO’s Sarajevo WWTP www.nato.int/sfor/cimic/env-pro/waterpla.htm Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 12/37
M&S in action: Environment www.hemmis.com/products/west/ Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 13/37
M&S in action: Traffic www.engr.utexas.edu/trafficSims/ Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 14/37
M&S in action: Training USC Institute for Creative Technologies www.ict.usc.edu Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 15/37
M&S in action: Game AI, Physics, Narratives, . . . www.info.ea.com/company/company tw.php Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 16/37
Modelling and Simulation . . . • . . . is Computer Science, Artificial Intelligence • . . . is Numerical Analysis, Computer Algebra • . . . is Systems Theory, Control Theory • . . . is Operations Research • . . . is Application Domain: Mechanical Engineering, . . . . . . or something more GENERIC ? Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 17/37
REALITY MODEL GOALS Real-World Base entity Model only study behaviour in experimental context within context Model Base System S Model M a-priori knowledge experiment simulate within context = virtual experiment validation Experiment Simulation Results Modelling and Simulation Observed Data Process Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 18/37
COMP 522 Concept Map Hierarchy of System Specifications is theory behind Formalisms Causal Block Diagrams time-less CBDs discrete-time CBDs continuous-time CBDs Discrete Event Finite State Automata (FSA) Event Scheduling Continuous-Time Activity Scanning CSSLs Statecharts Petri Nets Population Dynamics Process Interaction Forrester System Dynamics GPSS Modelica (multi-physics) DEVS Hybrid visualized using Animation Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 19/37
Which topics does the course cover ? 1. Modelling formalism syntax and semantics . The Causal Block Diagram formalisms. Plot TIME INDEP DEP 4.0 0.0 K X0 1.0 M 1.0 V0 ^−1 IC IC I O Print INDEP DEP Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 20/37
2. Untimed Discrete Event Formalisms: (a) (non)Deterministic State Automata . (b) Adding Concurrency and Synchronisation: Petri Nets ( e.g., specifying network protocols). Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 21/37
(c) Adding Hierarchy and Orthogonality: Statecharts ( e.g., UML, specifying reactive software). Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 22/37
3. Communicating Sequential Processes (CSP/kiltera). process sender[output]: seq print ("sender","sending","message") wait 0 -> send "message" to output -> print ("sender","sent message") process receiver[input]: seq print ("receiver","waiting for input") wait 2 -> receive msg from input -> print ("receiver","received",msg) main channel a in par sender[a] receiver[a] Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 23/37
4. Timed Discrete Event Formalisms: Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 24/37
(a) Event Scheduling . (b) Activity Scanning . (c) Three Phase Approach . (d) Process Interaction for queueing systems ( GPSS ). Function: 1 LNKS 10 12 FN1 V2 2 R PH1 0 1 V1 PH 1 LNKS PH1 LR PH2 LR R PH1 LNKS 2 V1 H S PH2 P1 NE P2 120 FN1 1 S PH1 Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 25/37
(e) DEVS as a rigourous basis for hierarchical modelling. 5. Deterministic Simulation of Stochastic Processes: (a) Pseudo Random Number Generation. (b) Gathering Statistics (performance metrics). 6. Animation 7. Continuous-time Formalisms: (a) Ordinary Differential Equations , Algebraic Equations, Differential Algebraic Equations. (b) CSSLs: sorting and algebraic loop detection. (c) Forrester System Dynamics , Population Dynamics . Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 26/37
trajectories predator uptake_predator prey loss_prey 600 Grazing_efficiency 400 prey_surplus_BR predator_surplus_DR Predator Prey 200 2−species predator−prey system 0 10 20 30 (d) Object-oriented Physical Systems Modelling: non-causal modelling, Modelica ( www.modelica.org ). 8. Hierarchy of System Specifications, Systems Theory. Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 27/37
Assignments cover these topics 1. A Causal Block Diagram simulation tool. 2. Petri Net model and analysis. 3. Statechart model and software synthesis. 4. kiltera model 5. GPSS (process interaction) model of a queueing system. 6. A DEVS model of a traffic system. Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 28/37
Project • For a formalism of choice (possibly construct your own): build a modelling and/or simulation environment. • Using an existing modelling/simulation system: study a specific problem. Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 29/37
Exam: mini-quiz(es) Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 30/37
What are the pre-requisites ? • COMP 251 (data structures and algorithms), • COMP 302 (programming languages and paradigms), • COMP 350 (numerical computing). . . . or equivalent (see me). Note: • all assignment/project programming in Python (where appropriate) • no prior knowledge required, read Tutorial at www.python.org Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 31/37
How is evaluation done ? • 60% on assignments. • 30% on the project (work, correctness, presentation). • 10% on a mini-quiz(es). Together, assignments, mini-quiz(es) and project cover the entire course. Hence, there is no final exam . Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 32/37
Assignment/project rules of the game ? • Completely in HTML form: requirements, design, code, discussion. • Submit via WebCT. • All coding in Python www.python.org (where appropriate). • Assignments and projects in teams of 2. Clearly describe work distribution ! • Original work, some presented in class. • Respect deadlines (or do more work to compensate). • Alternate subjects may be proposed. Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 33/37
Need help ? • Use the discussion forum in WebCT • Come and see me Monday 16:00 - 18:00 in MC328 • See the TA (Ximeng Sun) in MC202 • Send TA or me e-mail • Talk to me after class or make an appointment • Assignments/projects are never fully specified ! Give feedback ! Hans Vangheluwe hv@cs.mcgill.ca Modelling and Simulation 34/37
Recommend
More recommend