Object Oriented Discrete-Event Simulation CS4730 Fall 2010 Jose M. Garrido Department of Computer Science and Information Systems Kennesaw State University.

Slides:



Advertisements
Similar presentations
Modeling and Simulation By Lecturer: Nada Ahmed. Introduction to simulation and Modeling.
Advertisements

Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Introduction To System Analysis and Design
Chapter 3 Simulation Software
Classification of Simulation Models
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
1 SWE Introduction to Software Engineering Lecture 25 – Object-Oriented Design (Chapter 14)
Intro to Simulation and Virtual Reality CE Animation v Simulation Week 3.
Discrete-Event Simulation: A First Course Steve Park and Larry Leemis College of William and Mary.
Concurrency CS 510: Programming Languages David Walker.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Advanced Behavioral Modeling
Real-Time System Requirements & Design Specs Shaw - Chapters 3 & 4 Homework #2: 3.3.1, 3.4.1, Add Error states to Fig 4.1 Lecture 4/17.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
SE-565 Software System Requirements More UML Diagrams.
Teamwork Know each other Compete Leadership Strengths and Weaknesses
Basic Simulation Modeling II
EMBEDDED SOFTWARE Team victorious Team Victorious.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Modeling and Simulation
Introduction To System Analysis and design
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
An Introduction to Software Architecture
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
Introduction To System Analysis and Design
Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
1 Devon M. Simmonds University of North Carolina, Wilmington CSC450 Software Engineering WorkFlow Modeling with Activity Diagrams.
Behavioral Modeling Chapter 8.
Systems Analysis & Design 7 th Edition Chapter 5.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
CSC480 Software Engineering Lecture 11 September 30, 2002.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Modeling and Simulation Discrete-Event Simulation
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Lecture 1: Introduction to Software Engineering WXGE6103 Software Engineering Process and Practice Object-oriented Design.
Communicating Real-Time State Machines (CRSM) State machines that communicate synchronously Unique unidirectional channels are used for the communication.
Chap 10. Object-oriented Design - Designing systems using self-contained objects and object classes -
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
Systems Analysis and Design in a Changing World, Fourth Edition
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Object Oriented Discrete-Event Simulation with OOSimL Fall 2015 Dr. José M. Garrido Department of Computer Science College of Computing and Software Engineering.
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
COMP155 Computer Simulation September 10, Discrete Event Simulation  discrete event simulation: state variable change only at a discrete set of.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
Concurrent Object-Oriented Programming Languages Chris Tomlinson Mark Scheevel.
Slide 1 Chapter 10 Object-oriented Design. Slide 2 Characteristics of OOD l Objects are abstractions of real-world or system entities and manage themselves.
 Simulation enables the study of complex system.  Simulation is a good approach when analytic study of a system is not possible or very complex.  Informational,
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Simulation Examples And General Principles Part 2
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Basic Characteristics of Object-Oriented Systems
Traffic Simulation L2 – Introduction to simulation Ing. Ondřej Přibyl, Ph.D.
OPERATING SYSTEMS CS 3502 Fall 2017
Modeling and Simulation (An Introduction)
Unified Modeling Language
An Introduction to Software Architecture
Presentation transcript:

Object Oriented Discrete-Event Simulation CS4730 Fall 2010 Jose M. Garrido Department of Computer Science and Information Systems Kennesaw State University

Technical Attractions of Simulation * Ability to compress time, expand time Ability to control sources of variation Avoids errors in measurement Ability to stop and review Ability to restore system state Facilitates replication Modeler can control level of detail *Discrete-Event Simulation: Modeling, Programming, and Analysis by G. Fishman, 2001, pp (C) J. M. Garrido, 2009

Introduction What is discrete-event simulation? Modeling, simulating, and analyzing systems Computational and mathematical techniques Model: construct a conceptual framework that describes a system Simulate: perform experiments using computer implementation of the model Analyze: draw conclusions from output that assist in decision making process We will first focus on the model 3(C) J. M. Garrido, 2009

Characterizing a Model Deterministic or Stochastic Does the model contain stochastic components? Randomness is easy to add to a DES Static or Dynamic Is time a significant variable? Continuous or Discrete Does the system state evolve continuously or only at discrete points in time? Continuous: classical mechanics Discrete: queuing, inventory, machine shop models 4(C) J. M. Garrido, 2009

Definitions Discrete-Event Simulation Model Stochastic: some state variables are random Dynamic: time evolution is important Discrete-Event: significant changes occur at discrete time instances Monte Carlo Simulation Model Stochastic Static: time evolution is not important 5(C) J. M. Garrido, 2009

Programming Languages General-purpose programming languages Flexible and familiar Well suited for learning DES principles and techniques E.g.: C, C++, Java, Eiffel, Fortran, Ada Special-purpose simulation languages Most commercial simulation products are IDEs and not programming languages Good for building models quickly Provide built-in features (e.g., queue structures) Most provide graphics and animation E.g.: Arena, Flexim, Promodel, others 6(C) J. M. Garrido, 2009

Terminology Model vs. Simulation (noun) Model can be used WRT conceptual, specification, or computational levels Simulation is rarely used to describe the conceptual or specification model Simulation is frequently used to refer to the computational model (program) Model vs. Simulate (verb) To model can refer to development at any of the levels To simulate refers to computational activity Meaning should be obvious from the context 7(C) J. M. Garrido, 2009

Observations Make each model as simple as possible Never simpler Do not ignore relevant characteristics Do not include extraneous characteristics Model development is not sequential Steps are often iterated In a team setting, some steps will be in parallel Do not merge verification and validation Develop models at three levels Do not jump immediately to computational level Think a little, program a lot (and poorly); Think a lot, program a little (and well) 8(C) J. M. Garrido, 2009

Final Goal Discrete Event Simulation can provide valuable insight about the system 9(C) J. M. Garrido, 2009

Using Simulation Begin by studying trace-driven single server queue Follow that with a trace-driven machine shop model 10(C) J. M. Garrido, 2009

Approaches to Discrete-Event Simulation l Event approach l Activity approach l Process interaction approach Object oriented Psim3, and PsimJ2 use the full power of process interaction simulation. Other simulation packages and languages have limited OO support 11(C) J. M. Garrido, 2009

The Process Interaction Approach A simulation model using this approach consists of: A definition of the active and passive entities in the model. A description of how different active entities are going to interact among themselves, as time passes. A simulation run consists of creating and starting the passive and active objects. 12(C) J. M. Garrido, 2009

Advantages of the Process Style of Simulation Compatible with the Object-Oriented approach to modeling and programming, every process is an active object. Suitable for modeling large and complex systems. Threads are used to implement the active objects in the simulation models. 13(C) J. M. Garrido, 2009

Process Interaction Approach to Simulation with PsimJ2 A portable library package of Java classes Object-oriented Supports the process interaction approach A good tool for courses, such as: Object-oriented Simulation Object-oriented design and programming Operating systems Introduction to real-time systems 14(C) J. M. Garrido, 2009

Applying the Process Interaction Approach to Simulation The major components in a model are entities, these are modeled as active objects The active entities have a life of their own, and are called processes The passive entities are resources and queues The UML Collaboration diagram shows the process interactions 15(C) J. M. Garrido, 2009

Developing Simulation Models of Real-Time Systems The simulation models are more complex because they need to satisfy the requirements of real-time systems. A set of tasks are identified in developing such systems. Identifying these tasks will simplify the analysis and design phases of building a simulation model of real-time systems. 16(C) J. M. Garrido, 2009

Developing Models of RTS Concurrency – Multiple simultaneous activities. Synchronous Communication – Two or more communicate, where the sender will wait until the receiver gets the message. Timing Constraints – Describe the time windows during which activities must occur or respond. Communications Deadlines – Timers are used to place deadlines on how long a process can wait to communicate with another process. 17(C) J. M. Garrido, 2009

Train-Gate System Example Train-Gate System consists of a one- directional railway track crossing a road. The gate at the crossing must be lowered or raised by a Controller system. Sensors are used to detect entering trains and leaving trains. The signals from the sensors are sent to a Monitor, which keeps track of the number of trains in the area. 18(C) J. M. Garrido, 2009

Case Study: Train-Gate System Train Entry Sensor Train Exit Sensor Monitor ControllerGate Open Close Open/Close Signals Gate Opened / Closed Discrete Interarrival Times of Trains This simulation model is available at: 19(C) J. M. Garrido, 2009

Train-Gate System The real-time behavior of the Train-Gate System is modeled using Communicating Real-Time State Machines (CRSM). The timing constraints in CRSM are specified in the transitions between states, as shown in the diagram. The system design includes the common set of tasks identified in previous slides. Simulation of the Train-Gate system has been implemented using PsimJ2, a Java based discrete-event simulation package. The implementation of the system defines the processes: Controller, Gate, Train, Monitor, and Sensors. 20(C) J. M. Garrido, 2009

(C) J Garrido21 Processes Processes are implemented as threads in Java. The main body of a process is composed of a sequence of phases, after a phase is executed the control is returned to the simulation executive. The process executing a phase is the currently running process. From the system point of view, all processes are active and interacting at the same time.

(C) J Garrido22 Process View Static Process Description Dynamic Process Management Initiate Process Delay (Time) Process Suspend Process Activate Process Terminate Process

(C) J Garrido23 Resource View Standard/Tailored Resource Handler Resource Management Create resource Request resource Acquire resource Release resource Status of resource Destroy resource

(C) J Garrido24 Simulation Executive for the Process Interaction Approach Schedule processes at particular instants, i.e., place processes in the event list Remove processes from the event list ( to make them idle or to terminate them) Re-schedule processes, i.e., change position of processes in the event list. Execute the phase for the “running” process.

(C) J Garrido25 The Simulation Executive

(C) J Garrido26 Java Threads A thread consists of a set of phases, each of which is executed when the simulation executive advances the clock to the required time. Every thread re-starts execution at its own reactivation point (in the active phase), and its corresponding event time.

(C) J Garrido27 Thread With Its Reactivation Points

(C) J Garrido28 Using PsimJ2 Every simulation model defines a set of classes that will be instantiated appropriately The classes that represent processes need to inherit class Process, which is a thread class. The other classes defined are used to create passive objects.

(C) J Garrido29 Active and Passive Objects

(C) J. M. Garrido, Questions?