Develop DEVS Models Using DEVSJAVA Dr. Feng Gu. DEVS atomic model Elements of an atomic model input events output events state variables state transition.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

1 Various Methods of Populating Arrays Randomly generated integers.
An Introduction to Hashing. By: Sara Kennedy Presented: November 1, 2002.
Extended DEVSML as a Model Transformation Intermediary to Make UML Diagrams Executable Jianpeng Hu Dept. of Computer Science and Engineering Shanghai Jiao.
Written by: Dr. JJ Shepherd
1 CS2200 Software Development Lecture: Testing and Design A. O’Riordan, 2008 K. Brown,
Random (1) Random class contains a method to generate random numbers of integer and double type Note: before using Random class, you should add following.
Review CSC 171 FALL 2004 LECTURE 21. Topics Objects and Classes Fundamental Types Graphics and Applets Decisions Iteration Designing Classes Testing and.
DEVS and DEVS Model Dr. Feng Gu. Cellular automata with fitness.
Writing a Class (defining a data-type). Create a new project : Project (uncheck the “Create Main Class”)
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Chapter 6: Graphical User Interface (GUI) and Object-Oriented Design (OOD) J ava P rogramming: Program Design Including Data Structures Program Design.
CS-2851 Dr. Mark L. Hornick 1 Tree Maps and Tree Sets The JCF Binary Tree classes.
Computer Science 209 The Strategy Pattern II: Emulating Higher-Order Functions.
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 Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
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.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Main Index Contents 11 Main Index Contents Week 3 – The Vector Container.
Generic abstraction  Genericity  Generic classes  Generic procedures Programming Languages 3 © 2012 David A Watt, University of Glasgow.
The Architecture of GenDevs: looking under the hood of DEVSJAVA 3.0 Bernard P. Zeigler ACIMS Updated January 2004.
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.
Implementation of the Hangman Game in C++
ECE 449/549 Class Notes #1 Introduction to System Modeling Concepts and DEVS Sept
DEVS Based Modeling and Simulation of the CORBA POA F. Bernardi, E. de Gentili, Pr. J.F. Santucci {bernardi, gentili, University.
DEVS M&S Tutorial 2 Chungman Seo
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Modeling with Parallel DEVS Serialization in DEVS models Select function Implicit serialization of parallel models E-DEVS: internal transition first,
Probability Refresher COMP5416 Advanced Network Technologies.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
Simulator Protocol. coordinator simulator Component tN tN. tL After each transition tN = t + ta(), tL = t simulator Component tN tN. tL simulator Component.
Java Programming: From Problem Analysis to Program Design, Second Edition1 Lecture 5 Objectives  Learn about basic GUI components.  Explore how the GUI.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Review TEST 2 Chapters 4,5,7. QUESTION For which type of operands does the == operator always work correctly: (a) int, (b) double, or (c) String?
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Chapter 7: Class Inheritance F Superclasses and Subclasses F Keywords: super and this F Overriding methods F The Object Class F Modifiers: protected, final.
Constraints Assisted Modeling and Validation Presented in CS294-5 (Spring 2007) Thomas Huining Feng Based on: [1]Constraints Assisted Modeling and Validation.
DEVS and SES as a Framework for Modeling and Simulation Tool Development Bernard P. Zeigler Arizona Center for Integrative Modeling and Simulation University.
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
A: A: double “4” A: “34” 4.
DEVS-based Modeling and Simulation References: 1.B. P. Zeigler, Hessam S. Sarjoughian, Introduction to DEVS Modeling and Simulation with JAVA: Developing.
Approach and Techniques for Building Component-based Simulation Models Bernard P. Zeigler, Ph.D. Hessam S. Sarjoughian, Ph.D. Arizona Center for Integrative.
int [] scores = new int [10];
Knowledge Base. Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double.
ECE 449/549 Class Notes #2 Introduction to Discrete-Event Systems Specification (DEVS) Sept
Asserting Java © Rick Mercer Chapter 7 The Java Array Object.
© Rick Mercer Chapter 7 The Java Array Object.  Some variables store precisely one value: a double stores one floating-point number a double stores one.
Section 2.2 The StringLog ADT Specification. 2.2 The StringLog ADT Specification The primary responsibility of the StringLog ADT is to remember all the.
Basic concepts of C++ Presented by Prof. Satyajit De
Before we start Literature review abstract DEVSJAVA license form
Continue the car washer example Experimental frame
Parallel DEVS & DEVSJAVA
Lecture 12 Inheritance.
Intro To Classes Review
Continue the car washer example Experimental frame
Chapter16 Methodology: How to Model and Simulate
SyDEVS Introduction Theory – Paradigm – Implementation
DEVS Background DEVS = Discrete Event System Specification
Atomic Model Simulator
CSE 1030: Implementing Non-Static Features
Chapter 7 The Java Array Object © Rick Mercer.
Introduction to DEVSJAVA
DEVS Background DEVS = Discrete Event System Specification
MECH 3550 : Simulation & Visualization
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Topics OOP Review Inheritance Review Abstract Classes
COMPUTING.
Presentation transcript:

Develop DEVS Models Using DEVSJAVA Dr. Feng Gu

DEVS atomic model Elements of an atomic model input events output events state variables state transition functions -External transition -Internal transition -Confluent transition -Output function time advance function

How an atomic model works

DEVSJAVA environment Package structure How to develop models - programming How to run simulations – the SimView interface

Basic atomic variables

Basic atomic methods public double ta() : the time advance function; returns the value of sigma for atomic models public message out() : the output function; releases the message just before an internal transition public void deltint(): the internal transition function public void deltext(double e,message x): the external transition function public void deltcon(double e,message x): the confluent transition function public void Continue(double e) : subtract e from sigma; use to retain the same time of next event after an external event public void holdIn(String phase, double sigma) : set the phase and sigma values as given in the arguments public void passivateIn(String phase) : set the phase as given in the argument and sigma to INFINITY public void passivate() : set the phase to passive and sigma to INFINITY public boolean phaseIs(String phase) : return true if the current phase equals the argument public double ta(){return sigma; } public message out(){return new message()} //override public void deltint() {} //override public void deltext(double e,message x) {} //override public void deltcon(double e,message x){}//default deltint(); deltext(0,x); } public void Continue(double e){ if (sigma < INFINITY) sigma = sigma - e; } public void holdIn(String phase, double sigma) { this.phase = phase; this.sigma = sigma; } public void passivateIn(String phase) { holdIn(phase, INFINITY); } public void passivate() { passivateIn("passive"); } public boolean phaseIs(String phase){ return this.phase.equals(phase); }

Other commonly used methods The following methods are defined in devs, but commonly used by an atomic model -void Initialize() -boolean messageOnPort(message x,String p, int i) -ContentInterface makeContent(PortInterface port,EntityInterface value)

Class friendlyAtomic Methods public boolean somethingOnPort(message x,String port) : is there a value on the given port, e.g., somethingOnPort(x,”in”) public double geEntityOnPort(message x,String port): get the entity on the given port, e.g., getEntityOnPort(x,”in”) public double getIntValueOnPort(message x,String port): get the integer value on the given port, e.g., getIntValueOnPort(x,”in”) Note – assumes that the port only receives integer values public double getRealValueOnPort(message x,String port): get the real (double) value on the given port, e.g., getRealValueOnPort(x,”in”) Note – assumes that the port only receives real values public double sumValuesOnPort(message x,String port): sum up all the real values on the given port, e.g., sumValuesOnPort(x,”in”) Note – assumes that the port only receives real values public double getNameOnPort(message x,String port): get the name (string) value on the given port, e.g., getStringOnPort(x,”in”) Note – assumes that the port only receives name values public message outputNameOnPort(String nm,String port): output a name (string) on the given port, e.g., outputNameOnPort(“hello”,”out”) public message outputRealOnPort(double r,String port): output a real value (double) on the given port, e.g., outputRealOnPort(5,”out”) public message outputIntOnPort(int r,String port): output an integer value on the given port public void addNameTestInput(String port,String name,double elapsed): add a test which inputs the given name on the given port after an elapsed time, e.g., addNameTestInput(“in”,”hello”,5) public void addRealTestInput(String port,double value,double): add a test which inputs the given value on the given port after an elapsed time, e, e.g., addRealTestInput(“in”,10,5)

The GenDevs architecture

Collections, maps, relations

GenDevs collection classes

DEVS interfaces

DEVS-Canonical implementation

Major class relationships

Ports, content, and message

The DEVSJAVA Example: carWashSys 1. To simplify the problem, let’s first assume the system will reject any incoming cars and trucks if it is busy. 2. Test the model: addTestInput( ) 3. Test the model: create a car generator and couple it to the carWashCenter 4. Add random numbers in generators 5. Create a truck generator and add to the system 6. Add queue 7. Each car is unique – add vehicleEntity 8. Display message – implement the toString() in vehicleEntity 9. Show model state on SimView -- getTooltipText () 10. Add transducer 11. Test the model without SimView