Update 'populus_nigra_italica.lpy'

This commit is contained in:
Michał Dulski 2019-05-09 11:39:36 +00:00
parent 0345e094e6
commit a7cb71541b

View File

@ -1,16 +1,30 @@
import random
a = 50
def Start(): def Start():
#random.seed(150) #random.seed(150)
pass pass
Axiom: _(0.3)@GsG(0.5)A(1) Axiom: _(0.3)@GsG(0.5)A(1,1.0)
derivation length: 30 derivation length: 50
production: production:
A(x) : A(x,k) :
produce[-(30)F(1)B(1)]/(75)F(0.5)A(x+1) if x >= a-20:
produce [-(a-x)F(1,0.05+0.25/k)C(1,k)]/(75)F(0.7,0.05+0.25/k)A(x+1,k+0.1)
else:
produce[-(30)F(1,0.05+0.25/k)B(1,k)]/(75)F(0.5,0.05+0.25/k)A(x+1,k+0.1)
B(x): B(x,k):
if x <= 5: if x <= 5:
produce [^(30)F(1,0.05+0.25/x)Leaf(1)][&(30)F(1,0.05+0.25/x)Leaf(1)]F(1,0.05+0.25/x)B(x+1) r1 = random.random()
r2 = random.random()
produce [^(r1*50)F(1,0.05+0.25/k)-(20)Leaf(1)][&(r2*50)F(1,0.05+0.25/k)-(20)Leaf(1)]F(1,0.05+0.25/k)[-(20)Leaf(1)]B(x+1,k+1)
C(x,k):
if x <= 5:
r1 = random.random()
r2 = random.random()
produce [^(r1*50)F(1,0.05+0.25/k)-(20)Leaf(1)]F(1,0.05+0.25/k)[-(20)Leaf(1)]C(x+1,k+1)
Leaf(x): Leaf(x):
produce ~l(1) produce ~l(1)