T-statistic: Difference between revisions
Jump to navigation
Jump to search
en>Melcombe Revert to revision 431097913 dated 2011-05-27 00:12:41 by ClueBot NG using popups |
en>Yaris678 m Reverted edits by 8.192.1.52 using STiki |
||
Line 1: | Line 1: | ||
Given a coupled DEVS model, simulation algorithms are methods to generate the model's ''legal'' behaviors, which are a set of trajectories not to reach illegal states. (see [[Behavior of Coupled DEVS|behavior of a Coupled DEVS]] model.) [[Simulation_Algorithms_for_Coupled_DEVS#References|[Zeigler84]]] originally introduced the algorithms that handle time variables related to ''lifespan'' <math>t_s \in [0,\infty]</math> and ''elapsed time'' <math>t_e\in [0,\infty)</math> by introducing two other time variables, ''last event time'', <math>t_l\in [0,\infty)</math>, and ''next event time'' <math> t_n\in [0,\infty]</math> with the following relations: <center><math> \, t_e = t - t_l </math></center> | |||
and | |||
<center><math>\, t_s = t_n - t_l </math></center> | |||
where <math>t\in [0,\infty)</math> denotes the ''current time''. And the ''remaining time'', | |||
<center><math>\,t_r=t_s-t_e</math></center> is equivalently computed as | |||
<center><math>\, t_r = t_n - t</math></center>, apparently <math> t_r \in [0,\infty]</math>. | |||
Based on these relationships, the algorithms to simulate the behavior of a given Coupled DEVS are written as follows. | |||
== Algorithms == | |||
DEVS-coordinator | |||
Variables: | |||
parent // parent coordinator | |||
<math>t_l</math>: // time of last event | |||
<math>t_n</math>: // time of next event | |||
<math>N=(X, Y, D, \{M_i\}, C_{xx}, C_{yx}, C_{yy},Select)</math>// the associated [[DEVS#Coupled DEVS|Coupled DEVS]] model | |||
when receive init-message(Time ''t'') | |||
for each <math> i \in D </math> do | |||
send init-message(''t'') to child <math>i</math> | |||
<math>t_l \leftarrow \max\{t_{li}: i \in D\}</math>; | |||
<math>t_n \leftarrow \min\{t_{ni}: i \in D\}</math>; | |||
when receive star-message(Time ''t'') | |||
if <math>t \ne t_n </math> then | |||
error: bad synchronization; | |||
<math>i^* \leftarrow Select(\{i \in D: t_{ni} = t_n\});</math> | |||
send star-message(''t'')to <math>i^*</math> | |||
<math>t_l \leftarrow \max\{t_{li}: i \in D\}</math>; | |||
<math>t_n \leftarrow \min\{t_{ni}: i \in D\}</math>; | |||
when receive x-message(<math>x \in X</math>, Time ''t'') | |||
if <math>( t_l \le t </math> and <math> t \le t_n )</math> == false then | |||
error: bad synchronization; | |||
for each <math> (x,x_i) \in C_{xx} </math> do | |||
send x-message(<math>x_i</math>,''t'') to child <math>i</math> | |||
<math>t_l \leftarrow \max\{t_{li}: i \in D\}</math>; | |||
<math>t_n \leftarrow \min\{t_{ni}: i \in D\}</math>; | |||
when receive y-message(<math>y_i \in Y_i</math>, Time ''t'') | |||
for each <math> (y_i,x_i) \in C_{yx} </math> do | |||
send x-message(<math>x_i</math>,''t'') to child <math>i</math> | |||
if <math>C_{yy}(y_i)\ne \phi</math> then | |||
send y-message(<math>C_{yy}(y_i)</math>, ''t'') to parent; | |||
<math>t_l \leftarrow \max\{t_{li}: i \in D\}</math>; | |||
<math>t_n \leftarrow \min\{t_{ni}: i \in D\}</math>; | |||
==See also== | |||
* [[DEVS#Coupled DEVS|Coupled DEVS]] | |||
* [[Behavior of Coupled DEVS]] | |||
* [[Simulation Algorithms for Atomic DEVS]] | |||
== References == | |||
* [Zeigler84] {{cite book|author = Bernard Zeigler | year = 1984| title = Multifacetted Modeling and Discrete Event Simulation | publisher = Academic Press, London; Orlando | id = ISBN 978-0-12-778450-2 }} | |||
* [ZKP00] {{cite book|author = Bernard Zeigler, Tag Gon Kim, Herbert Praehofer| year = 2000| title = Theory of Modeling and Simulation| publisher = Academic Press, New York | id= ISBN 978-0-12-778455-7 |edition=second}} | |||
[[Category:Algorithms]] |
Revision as of 13:06, 17 December 2013
Given a coupled DEVS model, simulation algorithms are methods to generate the model's legal behaviors, which are a set of trajectories not to reach illegal states. (see behavior of a Coupled DEVS model.) [Zeigler84] originally introduced the algorithms that handle time variables related to lifespan
and elapsed time
by introducing two other time variables, last event time,
, and next event time
with the following relations:
and
where denotes the current time. And the remaining time,
is equivalently computed as
, apparently
.
Based on these relationships, the algorithms to simulate the behavior of a given Coupled DEVS are written as follows.
Algorithms
DEVS-coordinator Variables: parent // parent coordinator : // time of last event : // time of next event // the associated Coupled DEVS model when receive init-message(Time t) for each do send init-message(t) to child ; ; when receive star-message(Time t) if then error: bad synchronization; send star-message(t)to ; ; when receive x-message(, Time t) if and == false then error: bad synchronization; for each do send x-message(,t) to child ; ; when receive y-message(, Time t) for each do send x-message(,t) to child if then send y-message(, t) to parent; ; ;
See also
References
- [Zeigler84] 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.
My blog: http://www.primaboinca.com/view_profile.php?userid=5889534 - [ZKP00] 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.
My blog: http://www.primaboinca.com/view_profile.php?userid=5889534