Download presentation
Presentation is loading. Please wait.
Published byArchibald Brown Modified over 9 years ago
1
Modelling Cell-DEVS applications Cellular models implementation in CD++
2
N-dimensional cell spaces. Implementation of the Cell-DEVS N-dimensional zones with different behavior. Input/output events through specialized ports in predefined cells. CD++ (1998/99)
3
CD++ specification language for cell behavior n Manipulation of three-valued logic (T, F and ?). n Arithmetic operations (+, -, * and / ). n Operations using real numbers: trigonometric functions, roots, power, rounding, integer value, modulus, logarithms, factorial, absolute value, maximum, minimum, L.C.D., M.C.M., etc. boolean, comparison, arithmetic, time, conditionals, angle conversion, pseudo-random generation, error rounding, predefined constants. n Functions providing information about the neighborhood state (truecount, falsecount, undefcount y statecount(n)) CD++ (cont.)
4
n Cell-DEVS coupled model parameters n Cell-DEVS atomic models definition n Use the formal specification for each model n Definition of the local computing functions using a specification language. ValueDelay { Condition } Model Specification
5
Basic examples on the CD++ spec. language Is the diagonal true? (-1,-1) and (0,0) and (1,1) a False neighbour? FalseCount >= 1 Can I move in diagonal? not (-1,-1) or not (-1,1) or not (1,-1) or not (1,1)
6
Cell-DEVS coupled model. The ‘Life’ game [top] components : life [life] type : cell width : 20 height : 20 delay : transport defaultDelayTime : 100 border : wrapped neighbors : life(-1,-1) life(-1,0) life(-1,1) neighbors : life(0,-1) life(0,0) life(0,1) neighbors : life(1,-1) life(1,0) life(1,1) localtransition : life-rule [life-rule] rule : 1 100 { (0,0) = 1 and trueCount = 5 } rule : 1 100 { (0,0) = 0 and trueCount = 3 } rule : 0 100 { t } If the cell is alive and has 4 living neighbors, it remains alive. If it is dead and 3 living neighbors, it is born. Otherwise, it dies.
7
Life model execution Time: 00:00:00:000 01234567890123456789 +--------------------+ 0| | 1| | 2| | 3| | 4| | 5| *** | 6| | 7| * * * | 8| * *** * | 9| * * * | 10| | 11| *** | 12| | 13| | 14| | 15| | 16| | 17| | 18| | 19| | +--------------------+ Time: 00:00:00:100 01234567890123456789 +--------------------+ 0| | 1| | 2| | 3| | 4| * | 5| | 6| * * | 7| ** ** | 8| * * * | 9| ** ** | 10| * * | 11| | 12| * | 13| | 14| | 15| | 16| | 17| | 18| | 19| | +--------------------+ Time: 00:00:00:200 01234567890123456789 +--------------------+ 0| | 1| | 2| | 3| | 4| | 5| * | 6| * * | 7| | 8| * * * | 9| | 10| * * | 11| * | 12| | 13| | 14| | 15| | 16| | 17| | 18| | 19| | +--------------------+
8
[ExMedia] type : celldim : (9,9) delay : transportborder : wrapped neighbors : (-1,-1) (-1,0) (-1,1) (0,-1) neighbors : (0,1) (1,-1) (1,0) (1,1) (0,0) localtransition : Ex-rules [Ex-rules] rule : 0 100 {(0,0)=0 and statecount(2)=0 } rule : 2 100 {(0,0)=0 and statecount(2)>0 } rule : 1 100 { (0,0) = 2 } rule : 0 100 { (0,0) = 1 } rule : { (0,0) } 100 { t } Excitable Media
9
[Tension] type : cell dim : (40,40) delay : transport border : wrapped neighbors : (-1,-1) (-1,0) (-1,1) (0,-1) (1,-1) (1,0) (1,1) (0,0) (0,1) localtransition : Ten-rules [Ten-rules] rule : 0 100 { statecount(0) >= 5 } rule : 1 100 { t } Surface Tension
10
[top] components : ex1 in : in out : outG1 outG2 link : out1@ex1 outG1 link : out2@ex1 outG2 link : in in@ex1 [ex1] type : cell width : 2 height : 2 delay : transport defaultDelayTime : 1 in : in out : out1 out2 link : in in@ex1(1,1) link : output1@ex1(1,1) out1 link : output2@ex1(1,1) out2 portInTransition : in@ex1(1,1) specialRule localtransition : nothing-rule zone : generateOut { (1,1) } [nothing-rule] rule : { (0,0) } 1 { t } [specialRule] rule: { portValue(thisPort) } 1 { t } [generateOut] rule:{(0,0)+send(output1,9.9999)} 1 {(0,0)>=10} rule :{(0,0)+send(output2,3.3333)} 1 {(0,0)<10} Inputs/Outputs from/to other models
11
Cell’s Neighborhood Coupling Scheme 3-D heat diffusion model (stationary/transient). Heater/Cooler: DEVS models generating random numbers. Two input cells for heat/cold. A 3D heat diffusion model
12
[top] components : room Heater@Generator Cooler@Generator link : out@Heater inputHeat@room link : out@Cooler inputCold@room [room] type : cell dim : (4, 4, 4) delay : transport defaultDelayTime : 100 border : wrapped neighbors : room(-1,0,-1) room(0,-1,-1) room(0,0,-1) room(0,1,-1)... in : HeatInput ColdInput link : HeatInput in@room(3,3,0) link : HeatInput in@room(2,2,1) link : ColdInput in@room(3,3,2) link : ColdInput in@room(1,3,3) localtransition : heat-rule portInTransition : in@room(3,3,0) in@room(2,2,1) setHeat portInTransition : in@room(3,3,2) in@room(1,3,3) setCold [heat-rule] Rule: { ( (-1,0,-1)+(0,-1,-1)+(0,0,-1)+(0,1,-1)+(1,0,-1)+(-1,-1,0)+ (-1,0,0)+(-1,1,0)+(0,-1,0)+(0,0,0)+(0,1,0)+(1,-1,0)+(1,0,0)+ (1,1,0)+(-1,0,1)+(0,-1,1)+(0,0,1)+(0,1,1)+(1,0,1)+(0,0,-2)+ (0,0,2)+(0,2,0)+(0,-2,0)+(2,0,0)+(-2,0,0) ) / 25 } 1000 { t } [setHeat] rule : { uniform(24,80) } 1000 { t } [setCold] rule : { uniform(-45,10) } 1000 { t } [Heater] distribution : exponential mean : 10 initial : 1 Model’s specification
13
[ForestFire] type : celldim : (20,20) delay : inertialborder : nowrapped neighbors : (-1,-1) (-1,0) (-1,1) (0,-1) (0,0) (0,1) (1,-1) (1,0) (1,1) localtransition : FireBehavior [FireBehavior] rule : {(1,-1)+(21.552615/17.967136)} {(21.552615/17.967136)*60000} {(0,0)=0 and 0<(1,- 1)} rule : {(1,0)+(15.24/5.106976)} {(15.24 / 5.106976)*60000} {(0,0)=0 and 0<(1,0)} rule : {(0,-1)+(15.24/5.106976)} {(15.24 / 5.106976)*60000} {(0,0)=0 and 0<(0,-1)} rule : {(-1,-1)+(21.552615/1.872060)} {(21.552615 / 1.872060)*60000} {(0,0)=0 and 0<(- 1,-1)} rule : {(1,1)+(21.552615/1.872060)} {(21.552615/1.872060)*60000} {(0,0)=0 and 0<(1,1)} rule : {(-1,0)+(15.24/1.146091)} {(15.24 / 1.146091)*60000} {(0,0)=0 and 0<(-1,0)} rule : {(0,1)+(15.24/1.146091)} {(15.24 / 1.146091)*60000} {(0,0)=0 and 0<(0,1)} rule : {(-1,1)+(21.552615/0.987474)} {(21.552615/0.987474)*60000} {(0,0)=0 and 0<(- 1,1)} rule : {(0,0)} 0 { t } Forest Fire model
14
rule : -1 {60000*3} {(0,0)=0 and((-1,0)=-1 or (0,1)=-1 or (-1,0)=-2 or (0,1)=-2)} rule : -2 {60000*3.5} {(0,0)>0 and((-1,0)=-1 or(0,1)=-1 or (-1,0)=-2 or (0,1)=-2) rule : -3 {60000*4.5} {(0,0)=-2} rule : -4 {60000*5} {(0,0)=-3} rule : -1 60000 {(0,0)=0 and (-1,0)=-1} rule : -2 {60000*7} {(0,0)>0 and ((-1,1)=-1 or (-1,1)=-4) } rule : -3 {60000*9} {(0,0)=-2} rule : -4 {60000*9} {(0,0)=-3} Modified Forest Fires
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.