generator markov#

openalea.hydroroot.generator.markov.generate_g(seed=None, length_data=None, branching_variability=0.25, delta=0.002, nude_length=0.002, primary_length=0.13, segment_length=0.0001, order_max=4)[source]#

generate a MTG according to the input parameters using length_data (mendatory) for the branching

Preprocessing variables before calling markov_binary_tree():

  • nb_vertices: primary root length in vertex number

  • branching_delay: distance between branching in vertex number

  • nb_nude_vertices: distance from tip without branching in vertex number

  • length_law: the function giving the lateral length according to its position on the parent branch

Parameters:
  • seed – (int) - the seed for the random generator in the markof chain (Default value = None)

  • length_data – (Dataframe) - pandas dataframe columns names ‘LR_length_mm’ and ‘relative_distance_to_tip’ sorted by ‘relative_distance_to_tip’ (Default value = None)

  • branching_variability – (float) - variability on branching_delay and lateral lengths, \(\in [0, 1]\) (Default value = 0.25)

  • delta – (float) - reference distance (m) between successive branching axis (Default value = 2e-3)

  • nude_length – (float) - length (m) at root tip with no ramification (Default value = 2e-3)

  • primary_length – (float) - primary root length (m) (Default value = 0.13)

  • segment_length – (float) - length of the vertices (m) (Default value = 1e-4)

  • order_max – (int) - maximum lateral roots order (Default value = 4)

Returns:

  • g: MTG with the following properties set: edge_type, label, position

See also

hydroroot.law.length_law(), hydroroot.law.histo_relative_law(), hydroroot.main.root_builder()

openalea.hydroroot.generator.markov.linear(n=5)[source]#

Create a MTG with just one linear axis without properties.

Parameters:

n – (int) - number of vertices (Default value = 5)

Returns:

g (MTG)

openalea.hydroroot.generator.markov.markov_binary_tree(g=None, vid=0, nb_vertices=1500, branching_variability=0.1, branching_delay=20, length_law=None, nude_tip_length=200, order_max=5, seed=None, censure_variability=False, **kwargs)[source]#

Build a tree by modeling the stochastic process of lateral root branching by a first-order Markov chain on growing root axes. The building process is constrained by the arguments, see parameter descriptions.

if g not None then add the new tree to g at the vertex vid

Parameters:
  • g – (MTG) (Default value = None)

  • vid – (int) - the vertex id to which the new tree is added if not zero (Default value = 0)

  • nb_vertices – (int) - the number of vertices in the main axis (Default value = 1500)

  • branching_variability – (float) - variability on branching_delay and lateral lengths, \(\in [0, 1]\) (Default value = 0.1)

  • branching_delay – (float) - number of vertex between branching (Default value = 20)

  • length_law – function giving a length according to the branching position (Default value = None)

  • nude_tip_length – (float) - distance from tip without branching in vertices number (Default value = 200)

  • order_max – (int) - maximum root order (Default value = 5)

  • seed – (int) - a seed for the random generators (Default value = None)

  • censure_variability – (boolean) - deprecated because constrained by length_law- if True avoids to get a lateral longer than its parent (Default value = False)

Returns:

  • g (MTG)

See also

hydroroot.law.length_law(), hydroroot.law.histo_relative_law(), hydroroot.main.hydroroot_mtg()

openalea.hydroroot.generator.markov.my_seed()[source]#

generate my own seed function to capture the seed value.

openalea.hydroroot.generator.markov.shuffle_axis(g=None, shuffle=False)[source]#

For each subtree of a MTG, change its root node to another node of the same axis.

Parameters:
  • g – (Default value = None)

  • shuffle – (Default value = False)

Returns:

  • g

Download the source file ../../src/openalea/hydroroot/generator/markov.py.