Modelling DEVS applications The CD++ tool

Slides:



Advertisements
Similar presentations
McGill University School of Computer Science ‘07 Eugene Syriani and Hans Vangheluwe McGill University School of Computer Science 1.
Advertisements

MODELLING OF MOBILE AGENT SYSTEMS USING dynPLA APPROACH Agnė Paulauskaitė-Tarasevičienė Henrikas Pranevičius 1.
Eugene Syriani * † Hans Vangheluwe * ‡ Amr Al Mallah * † * ‡ Tuscaloosa, AL Montreal, Canada Antwerp, Belgium.
Review DEVS Formalism  Discrete-Event formalism: time advances using a continuous time base.  Basic models that can be coupled to build complex simulations.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
© Yilmaz “Introduction to DEVS” 1 Introduction to Model Conceptualization and Design Dr. Levent Yilmaz M&SNet: Auburn M&S Laboratory Computer.
Two main requirements: 1. Implementation Inspection policies (scheduling algorithms) that will extand the current AutoSched software : Taking to account.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
Academic Advisor: Prof. Ronen Brafman Team Members: Ran Isenberg Mirit Markovich Noa Aharon Alon Furman.
Performance Evaluation
The new The new MONARC Simulation Framework Iosif Legrand  California Institute of Technology.
Simulation Waiting Line. 2 Introduction Definition (informal) A model is a simplified description of an entity (an object, a system of objects) such that.
DEVS and DEVS Model Dr. Feng Gu. Cellular automata with fitness.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
Design Synopsys System Verilog API Donations to Accellera João Geada.
OMNET++. Outline Introduction Overview The NED Language Simple Modules.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
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}
(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.
DEVSView: A DEVS Visualization Tool Wilson Venhola.
Designing a Discrete Event Simulation Tool Peter L. Jackson School of Operations Research and Industrial Engineering March 15, 2003 Cornell University.
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.
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.
Computer Science 112 Fundamentals of Programming II Modeling and Simulation.
By Ezequiel Glinsky Research Assistant, University of Buenos Aires, Argentina Supervisor: Prof. Gabriel A. Wainer SCE, Carleton University Thursday, November.
ECE 449/549 Class Notes #1 Introduction to System Modeling Concepts and DEVS Sept
Definition of cell-shaped spaces. CCA = n C cell’s state variables; n S finite alphabet to represent each cell’s state; n n dimensional space; n N neighboring.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
DEVS Based Modeling and Simulation of the CORBA POA F. Bernardi, E. de Gentili, Pr. J.F. Santucci {bernardi, gentili, University.
SOFTWARE DESIGN. INTRODUCTION There are 3 distinct types of activities in design 1.External design 2.Architectural design 3.Detailed design Architectural.
Modeling with Parallel DEVS Serialization in DEVS models Select function Implicit serialization of parallel models E-DEVS: internal transition first,
Chapter 3 System Performance and Models Introduction A system is the part of the real world under study. Composed of a set of entities interacting.
Simulator Protocol. coordinator simulator Component tN tN. tL After each transition tN = t + ta(), tL = t simulator Component tN tN. tL simulator Component.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
12 Chapter 12: Advanced Topics in Object-Oriented Design Systems Analysis and Design in a Changing World, 3 rd Edition.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
CS 351/ IT 351 Modeling and Simulation Technologies Review ( ) Dr. Jim Holten.
(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.
DEVS-based Modeling and Simulation References: 1.B. P. Zeigler, Hessam S. Sarjoughian, Introduction to DEVS Modeling and Simulation with JAVA: Developing.
ACCESS CONTROL. Components of a Process  Address space  Set of data structures within the kernel - process’s address space map - current status - execution.
Review n System dynamics : A sequence of state transition n model : A set of rules for state transition System S X Y Discrete event system FSM (Automata)
The Abstract simulator Simulator/Simulation Concepts n Simulator: responsible for executing a model’s dynamics (resented as instructions) in a given.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
ECE 449/549 Class Notes #2 Introduction to Discrete-Event Systems Specification (DEVS) Sept
PDEVS Protocol Performance Prediction using Activity Patterns with Finite Probabilistic DEVS DEMO L. Capocchi, J.F. Santucci, B.P. Zeigler University of.
Extension du formalisme SES pour l’intégration de la hiérarchie d’abstraction et la granularité temporelle au sein de la modélisation et la simulation.
Introduction to Omnet++ By: Mahsa Soheil Shamaee.
Managing Data Resources File Organization and databases for business information systems.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Event Based Simulation of The Backfilling Algorithm OOP tirgul No
Review. Queue out done in Coupled model definition Generator out CPU outin Transducer cpuusagethroughput arrived solved.
Continue the car washer example Experimental frame
OPERATING SYSTEMS CS 3502 Fall 2017
OPERATING SYSTEMS CS 3502 Fall 2017
Process concept.
Chapter 3: Process Concept
Continue the car washer example Experimental frame
Event Relation Graphs and Extensions in Ptolemy II
SyDEVS Introduction Theory – Paradigm – Implementation
DEVS Background DEVS = Discrete Event System Specification
Process Description and Control
Lecture 2 Part 3 CPU Scheduling
DEVS Background DEVS = Discrete Event System Specification
Overview of Workflows: Why Use Them?
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process.
Presentation transcript:

Modelling DEVS applications The CD++ tool

n Atomic: lowest level model, contains structural dynamics -- model level modularity n Coupled: composed of one or more atomic and/or coupled models -- hierarchical construction Elements of an atomic model: n input ports n output ports n state variables n state transition functions n output function n time advance function Elements of coupled model: n Components n Couplings –Internal Couplings –External Input Couplings –External Output Couplings Review of the DEVS formalism

n Algorithmic languages n State-based languages n DEVS graph –Node : sequential state –Arc : (X  Y  {S})  ta(S) Internal transition External transition out ! y= (s 0 ) Internal Transition (i) ta(s 0 ) (ii) out =  (s 0 ),  int (s 0 )=s 1 External Transition  ext (s 0, t, (x,in))=s 2 DEVS graphs out ! (s 0 ) in ? x,t

DEVS graphs definition [modelname] atomic or coupled model name I/O ports: in : inport1 inport2... out : outport1 outport2... Internal transitions: int:source destination [outport!value]* ( { (action;)* } ) (Action: complex function to generate an output). External transitions : ext : source destination EXPRESSION ( { (action;)* } )? value

DEVS graphs definition n States (bubbles) n Internal transitions (dotted lines) n Output_port!output_value n External transitions (full lines) Input_port?input_value n I/O ports TL=inf TL=100 s

DEVS graphs analytical specification [myAtomic] in: Port1 PortY out: PortX state: Start Process Finish int: Process Finish PortX!1 ext: Start Process Value(Port1)?0 ext: Finish Start Value(PortY)?1 Start: 0:0:10:0 Process: 0:0:10:0 Finish: 0:0:10:0

CD++ (1997/98) Basic tool following DEVS formalism. Extension to include Cell-DEVS models. High level specification language.

Example: Robot Vehicle Model

Autonomous Reconnaissance Vehicle n Radar Controller Atomic model

Autonomous Reconnaissance Vehicle n Movement Controller

n holdIn(state, time) n passivate() n timelast() n timenext() n sendOutput(time, port, value) n state() n distribution().get() CD++ programming services

Adding new atomic models n Atomic model definitions  initFunction  externalFunction  outputFunction  internalFunction n Linking with the abstract simulator  registerNewAtomic

Generator out zRepresents a generator of impulses represented by consecutive natural numbers. zPeriod between impulses defined by a random function using different distributions (Chi 2, Gamma, Normal, etc.). Generator model: description 0, 1, 2,... f(t) =... Implementing atomic models

n External transition function: none (model does not include input ports) n Internal transition function: generates numbers according to a specified probability distribution. n Output function: sends following consecutive natural number through the out port. Transition functions Atomic model Generator Output Port : out 0, 1, 2,...  ext  int Generator: conceptual definition

class Generator:public Atomic { public:... protected: Model &initFunction() ; Model &externalFunction(const ExternalMessage &); Model &internalFunction(const InternalMessage &); Model &outputFunction(const InternalMessage&); private: int next; int initial; Port &out ; Distribution *distribution ; }; Generator model: header files

CD++ - initFunction Model &initFunction(){ this->next = this->initial; this->holdIn(Atomic::active, Time::Zero) ; return *this ; } Programmed to have an Instantaneous internal trans. Generator: coding example

CD++ - internalFunction Model &internalFunction(const InternalMessage &) { this->next++ ; Time t(fabs(this->distribution().get()) ) ; this->holdIn(active, t) ; return *this ; } Reprogrammed for the following internal transition. Obtains the time value by computing a probabilistic function Generator (cont.)

CD++ - outputFunction Model &outputFunction(const InternalMessage &msg) { this->sendOutput(msg.time(), this->out, this->next); return *this ; } The output value increments sequentially Generator (cont.)

out gen CD++ - Coupling scheme [top] components : out : Myout Link : Myout [gen] distribution : normal mean : 2 deviation : 1 top Myout Generator: stand-alone testing

Description zIt is in charge of computing the number of jobs finished in a given time unit. zIt computes the usage ratio for the server (a CPU in this case). zIt transfers the outputs with a given frequency. Transducer Jobs Transducer model

n The external transition function is in charge of record the jobs received and those finished. n The internal transition function should be activated in the following job burst. n The output function will send the metrics through output ports. DEVS Atomic Model Transducer cpuusage  ext  int arrived throughput solved Outputs Inputs Transducer model : conceptual definition

CD++ class Transducer: public Atomic { public:. protected: Model &initFunction(); Model &externalFunction(const ExternalMessage&); Model &internalFunction(const InternalMessage&); Model &outputFunction(const InternalMessage&); private: const Port &arrived, &solved ; Port &throughput, &cpuUsage ; Time frec, tUnit ; long procCount, cpuLoad ; JobsList unsolved ; }; Transducer: header files

Transducer: coding example CD++ - initFunction Model &initFunction() { cpuLoad = procCount = 0 ; unsolved.erase() ; this->holdIn( active, this->frequence() ) ; return *this ; } The results are sent with a predefined frequency. State variables initialization

CD++ - externalFunction Model &externalFunction( const ExternalMessage &msg ) { Time dif = ( msg.time() - this->lastChange() ) ; cpuLoad += dif.asMsecs() * unsolved.size() if( msg.port() == arrived ) unsolved[ msg.value() ] = msg.time() ; if( msg.port() == solved ) { procCount ++ ; unsolved.erase( msg.value() ) ; } return *this ; } Record a non- finished job Update the number of tasks CPU load Transducer (cont.)

CD++ - internalFunction Model &internalFunction( const InternalMessage & ) { this->holdIn( active, this->frequence() ) ; return *this ; } Programmed to inform the results with a certain frequency Transducer (cont.)

CD++ - outputFunction Model &outputFunction( const InternalMessage &msg ) { long ms = msg.time().asMsecs() ; float t( ms / this->timeUnit().asMsecs() ) ; Time dif = ( msg.time() - this->lastChange() ) ; cpuLoad += dif.asMsecs() * unsolved.size() ) ; this->sendOutput( msg.time(),throughput,procCount/t ); this->sendOutput( msg.time(),cpuUsage, cpuLoad / ms ); return *this ; } Transducer (cont.)

CPU model CPU out zA processor running individual tasks in a non preemptive fashion. zExecution time for each tasks defined by a probability distribution chosen by the user. Description 0, 1, 2,... f(t) =... in 0, 1, 2,...

CPU: conceptual definition n External transition function starts the processing a task. Internal transition scheduled for the end of the job, defined at random. If model already processing a task, new one is discarded. n Internal transition function finishes processing the job, leaving the model in a passive state waiting for new jobs. n Output function sends the job id trhough the output port out. Atomic Model CPU  ext  int out 0, 1, 2,... in 0, 1, 2,...

CPU: header files CD++ class CPU : public Atomic { public:. protected: Model &initFunction() ; Model &externalFunction(const ExternalMessage&); Model &internalFunction(const InternalMessage &); Model &outputFunction(const InternalMessage&); private: int pid; Port &in, &out ; Distribution *distribution ; };

CPU: coding example CD++ - initFunction Model &initFunction() { this->passivate() ; return *this ; } Passive state kept while cpu waits for new external events in input ports.

CD++ - externalFunction Model &externalFunction(const ExternalMessage &msg) { if( this->state() == passive ) { this->pid = static_cast (msg.value()) ; Time t( fabs(this->distribution().get()) ) ; this->holdIn(active, t) ; } return *this ; } Process Id stored. Schedule internal transition at random using the chosen distribution. CPU (Cont.)

CD++ - internalFunction Model &internalFunction( const InternalMessage & ) { this->passivate() ; return *this ; } Task processing finished. Passivate waiting for the following request. CPU (Cont.)

CD++ - outputFunction Model &outputFunction( const InternalMessage &msg ) { this->sendOutput(msg.time(), this->out, this->pid); return *this ; } Send Process Id and time associated with end of processing for the present task. CPU (Cont.)

CD++ - Coupling specification [top] components : in : in out : out Link : in Link : out [proc] distribution : normal mean : 2 deviation : 1 out proc top out in CPU model testing

out proc CD++ - External event file (.EV) 00:00:10:00 in 0 00:00:30:00 in 1 00:01:00:00 in 2 00:02:20:00 in 3 top out in Hh:mm:ss:ms Input port used Job Id Input events to test

Mensaje I / 00:00:00:000 / Root(00) para top(01) Mensaje I / 00:00:00:000 / top(01) para proc(02) Mensaje D / 00:00:00:000 / proc(02) /... para top(01) Mensaje D / 00:00:00:000 / top(01) /... para Root(00) Mensaje X / 00:00:10:000 / Root(00) / in / para top(01) Mensaje X / 00:00:10:000 / top(01) / in / para proc(02) Mensaje D / 00:00:10:000 / proc(02) / 00:00:01:348 para top(01) Mensaje D / 00:00:10:000 / top(01) / 00:00:01:348 para Root(00) Mensaje * / 00:00:11:348 / Root(00) para top(01) Mensaje * / 00:00:11:348 / top(01) para proc(02) Mensaje Y / 00:00:11:348 / proc(02) / out / para top(01) Mensaje D / 00:00:11:348 / proc(02) /... para top(01) Mensaje Y / 00:00:11:348 / top(01) / out / para Root(00) Mensaje D / 00:00:11:348 / top(01) /... para Root(00) Mensaje X / 00:00:30:000 / Root(00) / in / para top(01) Mensaje X / 00:00:30:000 / top(01) / in / para proc(02) Mensaje D / 00:00:30:000 / proc(02) / 00:00:03:485 para top(01) CD++ - Simulation Log file

CD++ - Output file 00:00:11:348 out 0 00:00:33:485 out 1 00:01:00:328 out 2 00:02:21:094 out 3 Hh:mm:ss:ms Output Port Job Id Output file