File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ It can then be instantiated in the axiom and modified during the simulation::
1818 Axiom: Apex(ApexParameters(age=0))
1919 dt = 1
2020 derivation length: 2
21+ production:
2122 Apex(p) :
2223 p.age += dt
2324 produce Node() Apex(p)
@@ -26,12 +27,12 @@ Creating the lsystem and running it the first time will produce the expected res
2627
2728 >>> l = Lsystem('mycode.lpy')
2829 >>> lstring = l.derive()
29- >>> print lstring
30+ >>> print( lstring)
3031 Node()Node()Apex(ApexParameters(age=2))
3132
3233However, a strange behavior occurs when asking for the axiom.::
3334
34- >>> print l.axiom
35+ >>> print( l.axiom)
3536 Apex(ApexParameters(age=2))
3637
3738In fact, this behavior is due to the way python manage object. By default, complex objects
@@ -40,7 +41,7 @@ are not copied but simply shared between variables.::
4041 >>> a = ApexParameters(age=0)
4142 >>> b = a
4243 >>> b.age = 2
43- >>> print a.age
44+ >>> print( a.age)
4445 2
4546
4647The variables ``b `` and ``a `` point toward the same object in memory. This one will be destroyed only when no variable
You can’t perform that action at this time.
0 commit comments