Atomic Model Simulator

Slides:



Advertisements
Similar presentations
How to use TinyOS Jason Hill Rob Szewczyk Alec Woo David Culler An event based execution environment for Networked Sensors.
Advertisements

8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
D u k e S y s t e m s Time, clocks, and consistency and the JMM Jeff Chase Duke University.
MODELLING OF MOBILE AGENT SYSTEMS USING dynPLA APPROACH Agnė Paulauskaitė-Tarasevičienė Henrikas Pranevičius 1.
Parallel and Distributed Simulation Lookahead Deadlock Detection & Recovery.
Lookahead. Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead.
Modeling & Simulation. System Models and Simulation Framework for Modeling and Simulation The framework defines the entities and their Relationships that.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
CPSC 668Set 14: Simulations1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
What we will cover…  Distributed Coordination 1-1.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
1. Explain why synchronization is so important in distributed systems by giving an appropriate example When each machine has its own clock, an event that.
EEC 688/788 Secure and Dependable Computing Lecture 12 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Synchronization Clock Synchronization Logical Clocks Global State Election Algorithms Mutual Exclusion.
DEVS and DEVS Model Dr. Feng Gu. Cellular automata with fitness.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Review. A_DA_A Ball_A Ball_B player_A B_DB_A Ball_B Ball_A player_B Ball_A Ball_B A_A, B_DA_D, B_A Ball_A Ball_B CFSM Player_A  : X  S  S X A = {Ball_A}
INTRODUCTION TO PROGRAMMING STRUCTURE Chapter 4 1.
P2P communication Using the GTalk Service API. Introduction Peer-to-Peer communication highly used in mobile devices. Very efficient to when certain factors.
Hardware Supported Time Synchronization in Multi-Core Architectures 林孟諭 Dept. of Electrical Engineering National Cheng Kung University Tainan, Taiwan,
DEVS Namespace for Interoperable DEVS/SOA
Discrete Event Modeling and Simulation of Distributed Architectures using the DSSV Methodology E. de Gentili, F. Bernardi, J.F. Santucci University Pascal.
Develop DEVS Models Using DEVSJAVA Dr. Feng Gu. DEVS atomic model Elements of an atomic model input events output events state variables state transition.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
ECE 449/549 Class Notes #1 Introduction to System Modeling Concepts and DEVS Sept
Communicating Real-Time State Machines (CRSM) State machines that communicate synchronously Unique unidirectional channels are used for the communication.
DEVS Based Modeling and Simulation of the CORBA POA F. Bernardi, E. de Gentili, Pr. J.F. Santucci {bernardi, gentili, University.
Chapter 5: Distributed objects and remote invocation Introduction Remote procedure call Events and notifications.
Distributed Virtual Environment and Simulation Package Stephen Lawrence
Modeling with Parallel DEVS Serialization in DEVS models Select function Implicit serialization of parallel models E-DEVS: internal transition first,
MODELING EXAMPLES Types of model Conceptual Containing components that have not been clearly Identified in terms of theoretic categories such as state,
Simulator Protocol. coordinator simulator Component tN tN. tL After each transition tN = t + ta(), tL = t simulator Component tN tN. tL simulator Component.
High Level Architecture Time Management. Time management is a difficult subject There is no real time management in DIS (usually); things happen as packets.
Transforming DEVS to Non-Modular Form For Faster Cellular Space Simulation Arizona Center for Integrative Modeling and Simulation Electrical and Computer.
ECE 449/549 Class Notes #3 DEVS Simulators and Executors / Methodology : How to model and simulate Sept
DEVS-based Modeling and Simulation References: 1.B. P. Zeigler, Hessam S. Sarjoughian, Introduction to DEVS Modeling and Simulation with JAVA: Developing.
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Approach and Techniques for Building Component-based Simulation Models Bernard P. Zeigler, Ph.D. Hessam S. Sarjoughian, Ph.D. Arizona Center for Integrative.
The Abstract simulator Simulator/Simulation Concepts n Simulator: responsible for executing a model’s dynamics (resented as instructions) in a given.
ECE 449/549 Class Notes #2 Introduction to Discrete-Event Systems Specification (DEVS) Sept
Engine Update time Update World List World List contains all of the objects/signals in the world state Factory Class State Machine Factory Lift Factory.
PDEVS Protocol Performance Prediction using Activity Patterns with Finite Probabilistic DEVS DEMO L. Capocchi, J.F. Santucci, B.P. Zeigler University of.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Simulation Engine (Simulator)‏. Outline Review of discrete time and discrete event simulation Standard simulator for DEVS atomic model Standard simulator.
Continue the car washer example Experimental frame
Appendix 3 Object-Oriented Analysis and Design
Servlets.
Parallel DEVS & DEVSJAVA
Applets.
Continue the car washer example Experimental frame
Parallel and Distributed Simulation Techniques
Chapter16 Methodology: How to Model and Simulate
Service-centric Software Engineering
DEVS Background DEVS = Discrete Event System Specification
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
EECS 498 Introduction to Distributed Systems Fall 2017
Copyright Joanne DeGroat, ECE, OSU
CSSSPEC6 SOFTWARE DEVELOPMENT WITH QUALITY ASSURANCE
Approach and Techniques for Building Component-based Simulation Models
Chapter 20 Object-Oriented Analysis and Design
Chapter 10 Object States and The Statechart Diagram
Multithreaded Programming
DEVS Background DEVS = Discrete Event System Specification
UML State Diagrams.
Last Class: Naming Name distribution: use hierarchies DNS
GoF Patterns Ch. 26.
Presentation transcript:

Atomic Model Simulator Every atomic model has a simulator assigned to it which keeps track of the time of the last event, tL and the time of the next event, tN. Initially, the state of the model is initialized as specified by the modeler to a desired initial state, sinit. The event times, tL and tN are set to 0 and ta(sinit), respectively. If there are no external events, the clock time, t is advanced to tN, the output is generated and the internal transition function of the model is executed. The simulator then updates the event times as shown, and processing continues to the next cycle. If an external event is injected to the model at some time, text (no earlier than the current clock and no later than tN), the clock is advanced to text. If text == tN the output is generated. Then the input is processed by the confluent or external event transition function, depending on whether text coincides with tN or not. m timeline (abstract or logica) tL tN inject at time t s =: s init tL =: 0 tN =: ta(sinit) If t == tN generate output  (s) When receive m if m!= null and t < tN, s := ext (s,t-tN,m) if m!= null and t == tN, s := con (s,t-tN,m) if m= null and t == tN, s =: int (s) Legend: m = message s = state t = clock time tL = time of last event tN = time of next event tL =: t tN =: t + ta(s) genDevs. simulation. atomicSimulator

Basic DEVS Simulation Protocol For a coupled model with atomic model components, a coordinator is assigned to it and coupledSimulators are assigned to its components. In the basic DEVS Simulation Protocol, the coordinator is responsible for stepping simulators through the cycle of activities shown. Coupled Model Coordinator: Coordinator sends nextTN to request tN from each of the simulators. All the simulators reply with their tNs in the outTN message to the coordinator Coordinator sends to each simulator a getOut message containing the global tN (the minimum of the tNs) Each simulator checks if it is imminent (its tN = global tN) and if so, returns the output of its model in a message to the coordinator in a sendOut message. Coordinator uses the coupling specification to distribute the outputs as accumulated messages back to the simulators in an applyDelt message to the simulators – for those simulators not receiving any input, the messages sent are empty. 1 nextTN Coupled Model 3 getOut coordinator 5 applyDelt 4 sendOut 2. outTN simulator Component tN tN. tL simulator Component tN tN. tL simulator Component tN tN. tL After each transition tN = t + ta(), tL = t Each simulator reacts to the incoming message as follows: If it is imminent and its input message is empty, then it invokes its model’s inernal transition function If it is imminent and its input message is not empty, it invokes its model’s confluence transition function If is not imminent and its input message is not empty, it invokes its model’s external transition function If is not imminent and its input message is empty then nothing happens.

Illustrating The DEVS Simulation Protocol within DEVS itself The DEVS Simulation Protocol can be illustrated within DEVSJAVA itself as follows: The coupled model, simTrip, represents the simulation of coupled model gpt. We define simulator and sCoordinator subclasses of atomic. The components of simTrip are: 3 instances of the simulator class, one each for g, p, and t 1 instance of the sCoordinator class. SimpArc gpt SimpArc simTrip SimpArc sCoordinator gpt SimpArc simulator

DEVS Simulation Protocol as Implemented in DEVSJAVA simulators. simulators. tellAll tellAll ("initialize“) --- at start of simulation ("initialize“) genDevs. simulation. coordinator coordinator simulators. simulators. AskAll AskAll (“ (“ nextTN nextTN ”) ”) simulators. simulators. tellAll tellAll (" (" computeInputOutput computeInputOutput “) “) simulators. simulators. tellAll tellAll (" (" sendMessages sendMessages ") ") simulators. simulators. tellAll tellAll (" (" DeltFunc DeltFunc “) “) DEVS cycle message message coupledSimulator coupledSimulator coupledSimulator Atomic Model Atomic Model Atomic Model Atoimc3 genDevs. simulation. coupledSimulator coupling

DEVS Simulation Protocol Classes Stand alone atomic models are assigned to AtomicSimulators Atomic models as components within coupled models are assigned to coupledSimulators Atomic Simulator coupledSimulator coordinator 1:n Coupled models are assigned to coordinators 1:n coupledCoordinator Coupled models as components within coupled models are assigned to coupledCoordinators genDevs. simulation. coupledSimulator genDevs. simulation. coordinator

Real-Time Simulator/Executor Execution in real time of an atomic model is similar to its simulation in logical or abstract time. The difference is that rather than being controlled by an events list within the coordinator, each simulator governs itself according to the host processor system clock. Thus passage of time in the model is identical to that of a wall clock. This difference is seen in the following alteration of the simulator: m real timeline tL tN inject at time t s =: s init tL =: 0 tN =: ta(sinit) If t == tN generate output  (s) sleep for ta(s) When receive m if m!= null and t < tN, s := ext (s,t-tN,m) if m!= null and t == tN, s := con (s,t-tN,m) if m= null and t == tN, s =: int (s) When first entering the state, s, the simulator starts a thread to sleep for a time ta(s) If an external event is injected to the model at some time, text (no earlier than the current clock and no later than tN), the sleeping thread is interrupted and If text == tN the output is generated. Then the input is processed by the confluent or external event transition function, depending on whether text coincides with tN or not. Legend: m = message s = state t = clock time tL = time of last event tN = time of next event tL =: t tN =: t + ta(s) genDevs. simulation.realTime atomicRTSimulator Real time execution of DEVS models is facilitated by the separation of model from simulator which allows the simulator to be “changed out” by one that adheres to a real clock. The ease of migration from simulation to execution enables a designprocess called model-continuity discussed later.