The plant graph is composed by
- nodes with coordinates & state in {0,1}
- ports with only state which is a real value
The initial graph is as follow:
|
initial graph |
The plant evolution graph consists in using three rules:
- the first rule consists in multipliing by 2 the coordinates & setting its state to 1 of all nodes whose state is 0.The pattern graph is composed with one node whose state is 0 and the transform graph is empty. The mapping muste selected the node with the same state, so the groupNodeIds is set to "state". The rule is written as follow:
1 #group node ids rules: make a partition of nodes depending on its state
3 #number of states rules
5 #The coordinates of the node with id 0 of pattern graph is multiplied by 2
7 #the state value of the node with id 0 of pattern graph is set to 0
- the secund rule consists in mutlipliing by 2 the state of a port. The pattern graph is a port and the transform graph is empty. The rule is written as follow:
1 #variable updater rules number
3 #the state of the port at index 0 is multiplied by 2
- the third rules consist in finding a pattern graph whose one node has its state equals to 1 & the another node state is equal to 0. The pattern is transformed by adding to node with state 0, 3 nodes with state equals to 1 are and 6 ports with state equals to 0.1. The cordinates of the new nodes depend on the pattern nodes coordinates. The rule is written as follow:
1 #list of ids of vertices of pattern graph to remove
3 #list of ids of edges of pattern graph to remove
5 #list of edges between Pattern graph & Transform graph to add
14 #mapping rules for pattern vertex
19 T_0=rotation(P_3-P_0,-PI/3)+2*P_3
20 T_1=rotation(P_3-P_0,PI/3)+2*P_3
The pattern & tranform graphs are as follow:
|
|
pattern graph |
transform graph |
To compute the 3 first rewriting graph, execute the command:
1 gpm_model.exe --verbose-mode=debug --path=./data --output=./output --prefix=plant --init=plant-init.txt --iterationsNumber=3 --verbose=./output/plant.log --nRules=3 --rule_1=plant-rule01.txt --pattern_1=plant-pattern01.txt --transform_1=plant-transform01.txt --rule_2=plant-rule02.txt --pattern_2=plant-pattern02.txt --transform_2=plant-transform02.txt --rule_3=plant-rule03.txt --pattern_3=plant-pattern03.txt --transform_3=plant-transform03.txt make run
The results of the rewriting graps are as follow:
|
|
init graph |
rewriting graph at iteration 1 |
|
|
rewriting graph at iteration 2 |
rewriting graph at iteration 3 |