Home | Download/Install | Documentation | Packages | Screenshots | News | Forum/Mailing-lists | Contact | GForge

Nozeran Model

The original Hallé sketch and the resulting 3D Lpy model

The following script generate an architecture :

import random as rd
 
stagelength = 4     # number of step between two verticille production
nbcycle = 4        # total number of verticille branches wanted 
minbranches = 3     # minimum number of branches when producing verticille
maxbranches = 5     # minimum number of branches when producing verticille
leafduration = 15   # life time of a leaf
leafmaturation = 6  # age at which a leaf is considered as old
angdev = 15         # authorized variation of angles to introduce some random
leafel = 60         # angle of leaf inclination from horizontal direction
radinc = 0.005      # increment of radius through time
 
def maxleafsize(s,maxs):      # maximum size of a leaf 
  return (s*0.5/float(maxs))+0.5
 
def leafsize(maxsize, t):     # size of a leaf according to its age
  if t < leafmaturation:
    return maxsize * ((t*0.5/float(leafmaturation))+0.5)
  else:
      return maxsize
 
def branch_angle(nc):         # branching angle according to position on trunk
    return 60+ 20*((nbcycle-nc)/float(nbcycle))
 
module A # represent trunk apical meristem
module B # represent apical meristem of lateral branches
module L # whorl of leaf
module I # Internode
 
Axiom: SetWidth(0.1)I(0.5,0.1)A(1,0)
 
derivation length: (nbcycle+1)*(stagelength+reiterationdelay) - 1
production:
 
A(t,o) :
  if o >= nbcycle:
      produce *
  nproduce I(1,0.1)/(90)L(maxleafsize(t%stagelength,stagelength)*1.5,0) 
  # produce a metamer
  if (t % (stagelength + 1)) == 0:
      # produce a verticille of branches.
      nbaxe = rd.randint(minbranches,maxbranches)
      for i in xrange(nbaxe):
        nproduce [/(360*i/nbaxe)&(branch_angle(o))B(0)]
      produce @Ge
  #produces a new shifted apical meristem
  if (t % (stagelength + 1)) == (stagelength):
      side = t // stagelength % 2 + 1
      nproduce [/(side*(-1)*60)+(45)@GcI(1,0.1)-(45)A(1,o+1)]     
  produce A(t+1,o) 
  # produce apex with older age.
 
B(t) :
  nproduce &(0.5)I(0.3+0.3/(1+t),0.1)
  if t % 2 == 0:
    nproduce K(0)
  produce B(t+1)
 
K(t) :
  # ages the branches leaves. If too old, removes
  if t <= leafduration :
    produce K(t+1)
  else:
    produce
 
L(maxsize,t) :
  # ages the trunk leaves. If too old, removes
  if t <= leafduration :
    produce L(maxsize,t+1)
  else:
    produce *  
 
I(s,r) --> I(s,r+radinc)
 
 
homomorphism:
 
I(a,r) --> SetWidth(r)F(a, r-radinc)
L(maxsize,t) --> [&(120);(2)~l(leafsize(maxsize,t))][^(120);(2)~l(leafsize(maxsize,t))]
 
K(t) --> [+(rd.uniform(90-angdev, 90+angdev))&(rd.uniform(leafel-angdev, leafel+angdev));(2)~l(leafsize(1,t))][-(rd.uniform(90-angdev, 90+angdev))&(rd.uniform(leafel-angdev, leafel+angdev));(2)~l(leafsize(1,t))]
 
 
endlsystem
 
packages/vplants/lpy/tutorials/archimodels/nozeran.txt · Last modified: 2008/07/31 09:42 by admin   Back to top
INRIA   INRA     CIRAD     AGROPOLIS IBC
INRIA GForge RSS feed Valid XHTML 1.0 Valid CSS Driven by DokuWiki