create.roots {SoPhy} | R Documentation |
This function generates root systems within a profile according to a given specification of the soil and the root model.
create.roots(h, trials = 10, PrintLevel=RFparameters()$PrintLevel, message=NULL)
h |
a list of the
same format as the output xswms2d ,
see there for a description of the components.
|
trials |
number of trials to find a realisation of the plant
positions (by a trial and error algorithm) where the distances have
a distance of at least $plants.mindist .
|
PrintLevel |
The higher the value the more tracing information is given;
up to value 2, no information is given.
Note that if PrintLevel>2 a running counter is shown that
includes the printing of backspaces
(^H).
The backspaces may have undesirable interactions with some few other
R functions, e.g.
Sweave .
See package RandomFields for the default option
RFparameters ()$Print .
|
message |
function with one parameter (string). The function is used to plot messages. |
The simulation algorithm works currently as follows.
$plants.lambda
a Poisson
random variable is drawn which gives the number of plants of this
type.
The starting points of the plants are created successively where the
horizontal positions are uniformly distributed over the profile.
The vertical position of the starting point is 1
plus the vertical position of the first
pixel that is not air at the drawn horizontal pixel.
If the simulated horizontal distance has distance less than
$plants.mindist
to any other plant of this type, the
horizontal distance is redrawn up to trials
- 1 times.
If still not successful the last drawn position is taken.
$stop.probab
. If this happens this root segment
is dropped from the list. This step is repeated until
the list is void (then the simulation of the root system
is terminated) or the growth does not stop.
no.own.root
is TRUE
the neighbouring pixel
may also not be a already simulated segment of the current root system.
$dir.ch.s
) of a Gaussian random variable.
$depth.bonus
or $side.bonus
if the neighbouring pixel will be in one of the three
pixels in vertical direction or in one of the two
horizontal directions.
$rf.link
function value for rf
that can be interpreted as water availability of soil quality.
knot.mindist
then the current root segment is a knot
with probility $knot.probab
.
The number of children is determined both by the number of
available neighbouring pixels and the values of
shoots.4
and shoots.3
.
$age.bonus
.
The function returns the input argument h
except that h$plants
, h$plant.idx
and h$rf
have been updated.
$plants |
is a list of simulated plants
where each components contains the
positions of the roots. The latter is given by a matrix of 8 columns:
|
$plant.idx |
vector or NULL . h$plant.idx[i] gives the
plant type (1,...,plant.types )
of the i th simulated plant. |
$Root.RF |
$Stone.RF modified as follows:
if h$root[[i]]$rf.Kf is TRUE then
the locations of the roots of plant type i get
the value of the function h$Kf .
|
Martin Schlather, martin.schlather@math.uni-goettingen.de http://www.stochastik.math.uni-goettingen.de/institute
Schlather, M. and Huwe, B. (2006) Modelling inhomogeneous soils:
Theory. In preparation.
## get a standard definition first h <- xswms2d(xlim=c(1, 100), ylim=c(1, 100), step=1, new=NULL) h$root[[1]]$plants.lambda <- 0.02 h <- simulateHorizons(h) for (i in 1:5) { plotRF(create.roots(h), cex.pch=0.5, pch=16, root.col=1) readline("Press return") }