1 / 27

DEVS = Discrete Event System Specification Provides formal M&S framework: specification,simulation

DEVS Background. DEVS = Discrete Event System Specification Provides formal M&S framework: specification,simulation Derived from Mathematical dynamical system theory Supports hierarchical, modular composition Object oriented implementation Supports discrete and continuous paradigms

winstont
Télécharger la présentation

DEVS = Discrete Event System Specification Provides formal M&S framework: specification,simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DEVS Background • DEVS = Discrete Event System Specification • Provides formal M&S framework: specification,simulation • Derived from Mathematical dynamical system theory • Supports hierarchical, modular composition • Object oriented implementation • Supports discrete and continuous paradigms • Exploits efficient parallel and distributed simulation techniques

  2. Experimental Frame Device for executing model Simulator Data: Input/output relation pairs modeling relation simulation relation Experimental frame specifies conditions under which the system is experimented with and observed Model Structure for generating behavior claimed to represent real world Basic Entities and Relations in Modeling and Simulation Real World Each entity is represented as a dynamic system Each relation is represented by a homomorphism or other equivalence

  3. DEVS Models There are two kinds of Models in DEVS • Atomic Model • Coupled Model

  4. 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 S

  5. DEVS Atomic Model Formalism

  6. x x 0 1 Discrete Event Time Segments X t1 t0 t2 (S,e) X Y S e y0 Y

  7. Atomic Model Operation • Ports are represented explicitly – there can be any number of input and output ports on which values can be received and sent • The time advance function determines the maximum lifetime in a state • A bag can contain many elements with possibly multiple occurrences of its elements. • Atomic DEVS models can handle bags of inputs and outputs. • The external transition function handles inputs of bags by causing an immediate state change, which also may modify the time advance. • The output function can generate a bag of outputs when the time advance has expired. • The internaltransition function is activated immediately after the output function and causs an immediate state change, which also may modify the time advance. • The confluent transition function decides the next state in cases of collision between external and internal events.

  8. Make a transition (internal) Make a transition (external) input State external internal time advance Handle input output output Hold for some time Send an output Dynamic of Atomic Model Modeling the qualifier exam

  9. start out receptive active passive fire refract Atomic Model Examples pulse Pulse Generator time Pulse Generator interPulseTime >0 Output start ta = ∞ Output Fire-once Neuron Input Firing delay >0 ta = ∞ ta = ∞ external event Internal event output event

  10. The DEVSJAVA Example: carGenr, carWashCenter

  11. Internal Transition /Output Generation output Generate output s’ Time advance s Make a transition using the output function using the internal transition function Discussion: time advance =0, = Infinity

  12. Response to External Input input Make a transition using the external transition function elapsed time Time advance Discussion: multiple inputs at the same time Discussion: You want to generate an output immediately to respond to the input

  13. Response to Simultaneous External Input and Internal Event output input Make a transition Generate output elapsed time using the confluent transition function Time advance Note: the output will be generated before the confluent function is executed

  14. Discussion • There is no way to generate an output directly from an external input event. An output can only occur just before an internal transition. • To have an external event cause an output without delay, we have it “schedule” an internal state with a hold time of zero • The output function does not change a model’s state • In general, the only way to interact with a model is through input/output ports. • An implementation issue -- An atomic model works with any object-oriented classes • A coupled model does not have its own states or state transition functions.

  15. x x 0 1 genDevs. modeling. atomic Basic Atomic Variables X t1 t0 t2 phase sigma: the scheduled remaining time in the current phase (busy, 20) (busy, 10) (wait, infinity) (wait, infinity) S elapse time: the time that elapsed in the current state e y0 Y

  16. genDevs. modeling. atomic 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 funciton 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); }

  17. Output input input fire refract receptive Firing delay >0 Fire-once Neuron This neuron fires exactly once after a fixed delay while ignoring all subsequent inputs public void initialize(){ super.initialize(); passivateIn("receptive"); } public void deltext(double e,message x){ Continue(e); if (phaseIs("receptive")&& somethingOnPort(x,"in")) holdIn("fire",fireDelay); } ignore all subsequent pulses pulse pulse pulse pulse input t fire Continue: sigma = sigma - e phase state receptive refract public void deltint(){ //if (phaseIs("fire")) passivateIn("refract"); } public message out(){ //if (phaseIs("fire")) return outputNameOnPort("pulse","out"); } sigma pulseModels foreOnceNeuron elapsed time pulse output

  18. Basic Generator Concepts pulseExpFrames. basicGenr third Duration second Duration 0 First Duration first second passive third active public void initialize(){ super.initialize(); holdIn("active",0); } public void deltext(double e,message x){ Continue(e); if (somethingOnPort(x,"start")) holdIn("first",firstDuration); else if (somethingOnPort(x,"stop")) passivate(); } public void deltint(){ if (phaseIs("active")) holdIn("first",firstDuration); else if (phaseIs("first")) holdIn("second",secondDuration); else if (phaseIs("second")) holdIn("third",thirdDuration); else passivate(); } public message out(){ if (phaseIs("active")) return outputRealOnPort(firstOutput,"out"); else if (phaseIs("first")) return outputRealOnPort(secondOutput,"out"); else if (phaseIs("second")) return outputRealOnPort(thirdOutput,"out"); else //if (phaseIs("third")) return outputRealOnPort(0,"out"); }

  19. DEVS Coupled Model Elements of coupled model: • Components • Interconnections • Internal Couplings • External Input Couplings • External Output Couplings

  20. Coupling in Action Coupling (internal) AB B A Output port Input port internal State external time advance output internal State external time advance output

  21. External input coupling External output coupling Internal coupling DEVS Hierarchical Modular Composition SimpArc.efa Atomic: lowest level model, contains structural dynamics -- model level modularity Coupled: composed of one or more atomic and/or coupled models hierarchical construction + coupling

  22. FireOnce Neuron 1 pulseIn pulseOut FireOnce Neuron 2 pulseOut pulseIn Pulse Generator pulseOut pulseIn FireOnce Neuron 4 pulseOut FireOnce Neuron 3 pulseIn pulseOut Coupled Model Example – Neuron net can compute the shortest path in a directed graph by mapping distances of edges to equivalent time values. • Small network of fire-once neurons • a pulse emitted from the generator explores two paths concurrently to reach the final neuron (number 4). • depending on the summed firing delays along each path, a pulse emerging from one or the other will arrive first to the final neuron, the other will be shut out and prevented from continuing • in general, the clock time when a pulse first arrives to a neuron represents the shortest time to reach it • if nodes and link distances are mapped to neurons and firing times, then the path taken by a pulse represents the shortest path of an associated digraph. • the path can be reconstructed by extending the neuron model to allow retracing the path of earliest firings. • This method turns out to be isomorphic to the well known Dikstrai shortest path algorithm. pulseModels. fireOnce NeuronNet If instead of shortest paths, we request longest paths, a net of neurons that fire after their assigned fireDelays every time they receive a pulse will do the job. Finding critical paths in PERT charts require such longest path computation.

  23. The DEVSJAVA Example: carWashSys

  24. An carwash example • Chapter 4: exercise 1 part a -- car wash • To simplify the problem, let’s first assume the system will reject any incoming cars and trucks if it is busy

  25. An carwash example • To simplify the problem, let’s first assume the system will reject any incoming cars and trucks if it is busy. • Test the model: addTestInput( ) • Test the model: create a car generator and couple it to the carWashCenter • Add random numbers in generators • Create a truck generator and add to the system • Add queue • Add transducer • Make the whole system generate an output • Test the model without SimView

  26. DEVS-based Modeling and Simulation • References: • B. P. Zeigler, Hessam S. Sarjoughian, Introduction to DEVS Modeling and Simulation with JAVA: Developing Component-Based Simulation Models, http://www.acims.arizona.edu/SOFTWARE/devsjava_licensed/CBMSManuscript.zip • B. P. Zeigler, H. Preahofer, T. G. Kim, Theory of Modeling and Simulation, New York, NY, Academic Press, 2000. • http://www.acims.arizona.edu

  27. Homework • Read paper: DEVS Component-Based M&S Framework: An Introduction • Install DEVS JAVA and play with the example – look into the code • Research topic

More Related