Tree Agent Module

class tree_agent.Tree(position, world, dbh, wood_density, h0, h1, cl0, cd0, cd1, cd2, rho, sigma, f0, f1, l0, l1, m, alpha, pmax, max_agb, rg, deltaDmax, DdeltaDmax, age, Ftype, Mb, Dfall=45, pfall=0.3, m_max=0.12, Dmort=10, max_dbh=None, id=None)[source]

Represents individual trees.

Args:
position: tuple

(x,y) coordinates of where tree will be stablished.

worldworld object

world where tree will live.

dbh: float

Diameter at Breast Height (in cm).

h0: float:

Height-stem diameter relationship parameter.

h1: float

Height-stem diameter relationship parameter.

cl0: float

Crown Length-Height relationship parameter.

cd0: float

Crown Diameter-Stem Diameter relationship parameter.

cd1: float

Crown Diameter-Stem Diameter relationship parameter.

cd2: float

Crown Diameter-Stem Diameter relationship parameter.

rho: float

Wood density in t of Organic Dry Matter/cubic meter.

sigma: float

Ratio of total aboveground biomass to stem biomass.

f0: float

Form factor-stem diameter relationship parameter.

f1: float

Form factor-stem diameter relationship parameter.

l0: float

Leaf Area Index (LAI)-Stem relationship parameter.

l1: float

Leaf Area Index (LAI)-Stem relationship parameter.

m: float

Light trasnmission coefficient.

alpha: float

Quantum eficiency; initial slope of the type speci

c light response curve.
pmax: float

Maximum leaf gross photosynthetic rate.

rg: float

Fraction of gross primary production available for growth that is attributed to growth respiration.

deltaDmax: float

Maximum diameter increment.

DdeltaDmax: float

% of Dmax that reaches deltaDmax.

age: int

Age (years).

Ftype: str

Functional type.

Mb: float): backgroung mortality probability. Dfall: float

Mimimum dbh for a tree to fall.

pfall: float

Probabbility that a tree with dbh>Dfall will fall.

m_max: float

Maximum size-dependent mortality for small trees.

Dmort: float

DBH up to which mortality is increased (for small trees).

Attributes:

ID (int): Instances (dict): DeadTrees (dict):

patch (tuple): (x,y) patch in which tree is located. f (float): k (float): lday (float): phi_act (float):

H: float

Height (m).

CL: float

Crown length (m).

CD: float

Crown diameter (m)

CA: float

Crown area (sq. m)

AGB: float

Above ground biomass (tODM)

LAI: float

Leaf area index.

lmax: float

Top layer occupied by this tree’s crown.

lmin: float

Bottom layer occupied by this tree’s crown.

L_mean: float

Average leaf area per layer.

Li: float

Amount of light receiveid by this tree.

Mc: float

Crowding mortality.

basic_m: float

Basic mortality.

Mb: float

Background mortality.

Md: float

Damage mortality.

GPP: float

Gross primary production in this time step.

Rm: float

Respiration maintenance in this timestep.

position: tuple

(x,y) coordinates of where tree is located.

world: world object

World where tree lives.

dbh: float

Diameter at Breast Height (in cm).

h0: float

Height-stem diameter relationship parameter.

h1: float

Height-stem diameter relationship parameter.

cl0: float

Crown Length-Height relationship parameter.

cd0: float

Crown Diameter-Stem Diameter relationship parameter.

cd1: float

Crown Diameter-Stem Diameter relationship parameter.

cd2: float

Crown Diameter-Stem Diameter relationship parameter.

rho: float

Wood density in t of Organic Dry Matter/cubic meter.

sigma: float

Ratio of total aboveground biomass to stem biomass.

f0: float:

Form factor-stem diameter relationship parameter.

f1: float:

Form factor-stem diameter relationship parameter.

l0: float

Leaf Area Index (LAI)-Stem relationship parameter.

l1: float

Leaf Area Index (LAI)-Stem relationship parameter.

m: float

Light trasnmission coefficient.

alpha: float

Quantum eciency; initial slope of the type-speci

c light response curve.
pmax: float

Maximum leaf gross photosynthetic rate.

rg: float

Fraction of gross primary production available for growth that is attributed to growth respiration.

deltaDmax: float

Maximum diameter increment.

DdeltaDmax: float

% of Dmax that reaches deltaDmax.

age: int

Age (years).

Ftype: str

Functional type.

Mb: float

Backgroung mortality probability.

max_height: float

Maximum height this tree can reach.

Dfall: float

Mimimum dbh for a tree to fall.

pfall: float

Probabbility that a tree with dbh>Dfall will fall.

m_max: float)

Maximum size-dependent mortality for small trees.

Dmort: float

DBH up to which mortality is increased (for small trees).

AGB_from_DBH(D)[source]

Calculate tree aboveground biomass (AGB) calculated according to eq.5 in SI-Fisher et al.(2015)

Returns: float

classmethod ActiveAgents()[source]

Returns: (list): containing the id of all active agents.

classmethod BackgroundMortality()[source]

Kill trees by calling their stochastic_Bm() method.

Biomass_gain()[source]

Calculate Aboveground Biomass (AGB) gain according to eq.43 in SI-Fisher et al.(2015).

Returns: float

CA_from_CD()[source]

Calculate tree crown area (CA) calculated according to eq.4 in SI-Fisher et al.(2015)

Returns: float

CD_from_DBH()[source]

Calculate tree crown diameter (CD) calculated according to eq.3 in SI-Fisher et al.(2015).

Returns: float

CL_from_H()[source]

Calculate tree crown_length (CL) calculated according to eq.2 in SI-Fisher et al.(2015)

Returns: float

classmethod Cgpp()[source]

Calculate the total Carbon absorbed as Gross Primary Production.

Returns: float

Total Carbon absorbed.

classmethod CountFruits()[source]

Counts the total number of fruits in the landscape. Fruits from all trees of all Functional Types are counted.

Returns: int

Number of fruits.

classmethod Cr()[source]

Calculate the total Carbon released through respiration.

Returns: float

Total Carbon released by all living trees.

classmethod CrowdingMortality()[source]

Kill trees by calling their stochastic_Cm() method.

DBH_from_Biomass(B)[source]

Calculate diameter at breast height from above ground biomass.

Returns: float

The DBH calculated from AGB.

classmethod DamageMortality()[source]

Kill trees by calling their stochastic_Dm() method.

classmethod DisperseSeeds()[source]

Makes all trees with diameter bigger than 10 cm disperse their seeds.

Returns: None

H_from_DBH()[source]

Calculate tree height calculated according to eq.1 in SI-Fisher et al.(2015).

Returns: float

LAI_from_DBH()[source]

Calculate the leaf area index (LAI) calculated according to eq.7 in SI-Fisher et al.(2015)

Returns: float

Lind()[source]

Calculate the incoming radiation on top of lmax layer the tree is reaching according to eq.36 in SI-Fisher et al.(2015).

Returns: float

Incoming radiation on top of this tree.

classmethod MaxHeight()[source]

Finds the height of the tallest tree in the current time step.

Returns:

(float): height of the tallest tree.

classmethod Mortality()[source]

Kill trees by calling their stochastic_M() method.

Pind(Li)[source]

Calculate the interim gross photosynthetic rate of one tree per year, according to eq.40 in SI-Fisher et al.(2015)

Returns: float

Gross photosynthetic rate.

classmethod ProduceFruits()[source]

Makes all trees with diameter bigger than 10 cm produce fruits.

Returns: None

classmethod Total_AGB()[source]

Calculate the total Above Ground Biomass for all living trees.

Returns: float

Total Aboveground Biomass in tons of Organic Dry matter (tODM).

classmethod TreeFactory(new_cls_name, new_parameters)[source]

Creates a Tree subclass to represent a Functional Type.

Args:
new_cls_name: str

Name of the functional type

new_parameters: dict

Dictionary containing the the parameters specific to each functional type. The following format is expected:

{‘h0’:value,

‘h1’:value, ‘cl0’:value, ‘cd0’:value, ‘cd1’:value, ‘cd2’:value, ‘rho’:value, ‘sigma’:value, ‘f0’:value, ‘f1’:value, ‘l0’:value, ‘l1’:value, ‘m’:value, ‘alpha’:value, ‘pmax’:value, ‘max_dbh’:value, ‘deltaDmax’:value, ‘DdeltaDmax’:value, ‘Dmort’:value, ‘Dfall’:value, ‘pfall’:value, ‘rg’:value, ‘m_max’:value,

}

Returns: Tree subclass

A subclass of the Tree class with the provided parameter values as default.

classmethod TreesAboveDBH(dbh)[source]

Calculate the total number of trees with DBH above the speciefied threshold.

Returns: int

Number of trees.

classmethod TreesPerPatch()[source]

Identify which trees are in each patch.

Returns:

(dict): keys are patch coordinates ‘(x,y)’ and values are lists of trees ids in that patch.

classmethod UpdateTrees()[source]

Updates all living trees

Returns: None

calculate_Ms()[source]

Calculate the size-dependent mortality for small trees according to model description in Ruger et al. 2007. (SI, page 4).

Returns: float

calculate_alpha0()[source]

Calculate the alpha0 growth paramenter, according equations described in sctions F-5 (page 24) of SI-Fisher et al.(2015).

Returns: float

calculate_alpha1()[source]

Calculate alpha1 growth paramenter, according equations described in sctions F-5 (page 24) of SI-Fisher et al.(2015).

Returns: float

calculate_f()[source]

Calculate the form factor (f) calculated according to eq.6 in SI-Fisher et al.(2015)

Returns: float

calculate_rm()[source]

Calculate the maintenance respiration rate(rm) according to eq.46 in SI-Fisher et al.(2015).

Returns: float

calculate_volume()[source]

Calculate the volume of the stem based on DBH.

Returns: float

decrement_fruit_stock(n=1)[source]

Decreases the fruit stock bt n.

Args:
n: int

Number of fruits

disperse_seeds(fraction=0.5, a=0.3, maximum_distance=100)[source]

Disperse seeds according to a power distribution.

Seeds are deposited in the topology’s seedbank.

Power function:

P(x|a)=a*x^(a-1)

Args:
fraction: float

Fraction (between 0.0 and 1.0) of the available fruits to be dispersed ( each fruit contains one seed).

a: float

Power factor

maximum_distance: float

Maximun distance (from the tree) at which a seed can be deposited.

Returns: None

fall()[source]

Inflict damage on other trees affected by the falling one.

fruits_from_DBH()[source]

Calculates the number of new fruits based on stem diameter

TODO:

*Make ‘adj’ a functional type level parameter (a class attribute)

growth(D)[source]

Calculate the yearly diameter growth according to eq.48 in SI-Fisher et al.(2015). Assumes full availabilty of resources

Returns: float

Diameter growth.

import_attributes(attributes)[source]

Updates this tree’s attributes with the values in ‘attributes’.

Args:
attributes: dict

A dict with attribute name : value. The following attributes are expected:

{“DBH”:value, “H”:value, “CL”:value, “CD”:value, “CA”:value, “AGB”:value, “LAI”:value, “lmax”:value, “lmin”:value, “L_mean”:value, “Li”:value, “Mc”:value, “Mb”:value, “age”:value, “available_fruits”:value,

}

increase_DBH()[source]

Increase tree DBH according to gain in biomass.

Note: If DBH decreases to zero, remove tree.

Returns: None

log_me()[source]

Cut down this tree.

Randomly determines where tree is going to fall and inflict damage in the the trees hit by the crown. Only trees with DBH< 50 cm are damaged.

The carbon of this trees is not added to any Stock.

random_seed_position(distance)[source]

Randomly selects a point within a circle of radius= ‘distance’ for a seed to be deposited.

Args:
distance: float

Maximun distance (from the tree) at which a seed can be deposited.

Returns: tuple

(x,y) seed position.

remove_me()[source]

Kill this tree.

stochastic_Bm()[source]

Stochastic Background mortality.

Returns: bool

True if tree dies from background mortality.

stochastic_Cm()[source]

Stochastic crownding mortality.

Returns: bool

True if tree dies from crowding.

stochastic_Dm()[source]

Stochastic damage mortality.

Returns: bool

True if tree dies from damage.

stochastic_M()[source]

Stochastic mortality.

Returns:

(bools): True if tree should be removed.

update()[source]

Updates geometry related parameters and mortality probabilities.

Returns: dict

A dictionary with the new attribute values. Can be imported by the ‘import_attributes’ method.

The following attributes are returned:

{“DBH”:value, “H”:value, “CL”:value, “CD”:value, “CA”:value, “AGB”:value, “LAI”:value, “lmax”:value, “lmin”:value, “L_mean”:value, “Li”:value, “Mc”:value, “Mb”:value, “age”:value, “available_fruits”:value,

}