[{"@context":"http:\/\/schema.org\/","@type":"BlogPosting","@id":"https:\/\/wiki.edu.vn\/en\/wiki8\/simulation-algorithms-for-atomic-devs\/#BlogPosting","mainEntityOfPage":"https:\/\/wiki.edu.vn\/en\/wiki8\/simulation-algorithms-for-atomic-devs\/","headline":"Simulation algorithms for atomic DEVS","name":"Simulation algorithms for atomic DEVS","description":"before-content-x4 Given an atomic DEVS model, simulation algorithms are methods to generate the model’s legal behaviors which are trajectories not","datePublished":"2016-06-22","dateModified":"2016-06-22","author":{"@type":"Person","@id":"https:\/\/wiki.edu.vn\/en\/wiki8\/author\/lordneo\/#Person","name":"lordneo","url":"https:\/\/wiki.edu.vn\/en\/wiki8\/author\/lordneo\/","image":{"@type":"ImageObject","@id":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@type":"Organization","name":"Enzyklop\u00e4die","logo":{"@type":"ImageObject","@id":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","url":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","width":600,"height":60}},"image":{"@type":"ImageObject","@id":"https:\/\/wikimedia.org\/api\/rest_v1\/media\/math\/render\/svg\/79271fd0ef3aab6c30848858b171090c99378c3f","url":"https:\/\/wikimedia.org\/api\/rest_v1\/media\/math\/render\/svg\/79271fd0ef3aab6c30848858b171090c99378c3f","height":"","width":""},"url":"https:\/\/wiki.edu.vn\/en\/wiki8\/simulation-algorithms-for-atomic-devs\/","wordCount":6502,"articleBody":" (adsbygoogle = window.adsbygoogle || []).push({});before-content-x4Given an atomic DEVS model, simulation algorithms are methods to generate the model’s legal behaviors which are trajectories not to reach to illegal states. (see Behavior of DEVS). [Zeigler84] originally introduced the algorithms that handle time variables related to lifespan ts\u2208[0,\u221e]{displaystyle t_{s}in [0,infty ]} (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4 and elapsed time te\u2208[0,\u221e){displaystyle t_{e}in [0,infty )} by introducing two other time variables, last event time, tl\u2208[0,\u221e){displaystyle t_{l}in [0,infty )}, and next event time (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4tn\u2208[0,\u221e]{displaystyle t_{n}in [0,infty ]} with the following relations:te=t\u2212tl{displaystyle ,t_{e}=t-t_{l}}and (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4ts=tn\u2212tl{displaystyle ,t_{s}=t_{n}-t_{l}}where t\u2208[0,\u221e){displaystyle tin [0,infty )} denotes the current time. And the remaining time,tr=ts\u2212te{displaystyle ,t_{r}=t_{s}-t_{e}} is equivalently computed astr=tn\u2212t{displaystyle ,t_{r}=t_{n}-t}, apparently tr\u2208[0,\u221e]{displaystyle t_{r}in [0,infty ]}.Since the behavior of a given atomic DEVS model can be defined in two different views depending on the total state and the external transition function (refer to Behavior of DEVS), the simulation algorithms are also introduced in two different views as below.Table of ContentsCommon parts[edit]View 1: total states = states * elapsed times[edit]View 2: total states = states * lifespans * elapsed times[edit]See also[edit]References[edit]Common parts[edit]Regardless of two different views of total states, algorithms for initialization and internal transition cases are commonly defined as below.DEVS-simulator variables: parent \/\/ parent coordinator tl{displaystyle t_{l}} \/\/ time of last event tn{displaystyle t_{n}} \/\/ time of next event A=(X,Y,S,ta,\u03b4ext,\u03b4int,\u03bb){displaystyle A=(X,Y,S,ta,delta _{ext},delta _{int},lambda )}\/\/ the associated Atomic DEVS model when receive init-message(Time t{displaystyle t}) tl\u2190t;{displaystyle t_{l}leftarrow t;} tn\u2190tl+ta(s);{displaystyle t_{n}leftarrow t_{l}+ta(s);} when receive star-message(Time t{displaystyle t}) if t\u2260tn{displaystyle tneq t_{n}} then error: bad synchronization; y\u2190\u03bb(s);{displaystyle yleftarrow lambda (s);} send y-message(y,t{displaystyle y,t}) to parent; s\u2190\u03b4int(s){displaystyle sleftarrow delta _{int}(s)} tl\u2190t;{displaystyle t_{l}leftarrow t;} tn\u2190tl+ta(s);{displaystyle t_{n}leftarrow t_{l}+ta(s);}View 1: total states = states * elapsed times[edit]As addressed in Behavior of Atomic DEVS, when DEVS receives an input event, right calling \u03b4ext{displaystyle delta _{ext}}, the last event time,tl{displaystyle t_{l}} is set by the current time,t{displaystyle t}, thus the elapsed timete{displaystyle t_{e}} becomes zero because te=t\u2212tl{displaystyle t_{e}=t-t_{l}}. when receive x-message(x\u2208X{displaystyle xin X}, Time t{displaystyle t}) if (tl\u2264t{displaystyle (t_{l}leq t} and t\u2264tn){displaystyle tleq t_{n})} == false then error: bad synchronization; s\u2190\u03b4ext(s,t\u2212tl,x){displaystyle sleftarrow delta _{ext}(s,t-t_{l},x)} tl\u2190t;{displaystyle t_{l}leftarrow t;} tn\u2190tl+ta(s);{displaystyle t_{n}leftarrow t_{l}+ta(s);}View 2: total states = states * lifespans * elapsed times[edit]Notice that as addressed in Behavior of Atomic DEVS, depending on the value of b{displaystyle b} return by \u03b4ext{displaystyle delta _{ext}}, last event time,tl{displaystyle t_{l}}, and next event time,tn{displaystyle t_{n}},consequently, elapsed time, te{displaystyle t_{e}}, and lifespantn{displaystyle t_{n}}, are updated (if b=1{displaystyle b=1}) or preserved (if b=0{displaystyle b=0}). when receive x-message(x\u2208X{displaystyle xin X}, Time t{displaystyle t}) if (tl\u2264t{displaystyle (t_{l}leq t} and t\u2264tn){displaystyle tleq t_{n})} == false then error: bad synchronization; (s,b)\u2190\u03b4ext(s,t\u2212tl,x){displaystyle (s,b)leftarrow delta _{ext}(s,t-t_{l},x)} if b=1{displaystyle b=1} then tl\u2190t;{displaystyle t_{l}leftarrow t;} tn\u2190tl+ta(s);{displaystyle t_{n}leftarrow t_{l}+ta(s);}See also[edit]References[edit][Zeigler84] Bernard Zeigler (1984). Multifacetted Modeling and Discrete Event Simulation. Academic Press, London; Orlando. ISBN\u00a0978-0-12-778450-2.[ZKP00] Bernard Zeigler; Tag Gon Kim; Herbert Praehofer (2000). Theory of Modeling and Simulation (second\u00a0ed.). Academic Press, New York. ISBN\u00a0978-0-12-778455-7. (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4"},{"@context":"http:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki8\/#breadcrumbitem","name":"Enzyklop\u00e4die"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/wiki.edu.vn\/en\/wiki8\/simulation-algorithms-for-atomic-devs\/#breadcrumbitem","name":"Simulation algorithms for atomic DEVS"}}]}]