| create.stones {SoPhy} | R Documentation |
This function simulates stones within a profile according to a given soil definition. The algorithm returns an intermediate stage of the random sequential adsoption (RSA) model.
create.stones(h, trials = 10)
h |
a list of the
same format as the output of xswms2d |
trials |
parameter for the
number of trials after which the simulation for a horizon terminates
and a warning is given.
The number of trials equals, for each horizon,
trials times the Poisson random number of
stones to simulate, see also Details.
|
In the simulation, each horizon is considered separately in the ordering they are defined. The ordering is important in case the stones are allowed to reach into neighbouring horizons. For each horizon:
h$stone$lambda times modulus of the area of the horizon [in
the given units].
trials times p:
cut.x and
cut.y and that encloses the area of the horizon a uniformly
distributed point P is draw. If the point is outside the horizon,
the drawing is repeated, up to trials times. If still not
successful, the simulaton for a horizon terminates, a warning is
given, the stones
simulated up to now are kept and the next
horizon is simulated.
$stone$phi.distr, $stone$phi.mean,
$stone$phi.s,
$stone$main.distr, $stone$main.mean,
$stone$main.s,
$stone$sec.distr, $stone$sec.mean, and
$stone$sec.s,
stone$main.distr, mean parameter
$stone$main.mean and standard deviation
$stone$main.s.
The length of the secondary axis and
the angle between the main axis and the horizon are given in
a similar way.
$stone$no.overlap is TRUE and any of the
pixels belong already to a stone
$stone$no.lower is TRUE and any pixel
belongs to a horizon or polygon that precedes the current one.
$stone$no.upper is TRUE and any pixel
belongs to a horizon or polygon that follows the current one.
The function returns the input argument h
except that h$idx.rf and h$Stone.RF have been updated.
|
gives, at first instance, the association of a pixel
to a horizon (0,...,h$n-1).
If the pixel belongs to one or more stones the value
of the maximum number of horizons is added. |
|
RF, modified at the locations with stones
according to the h[[...]]$stone$values.
|
Martin Schlather, schlath@hsu-hh.de http://www.unibw-hamburg.de/WWEB/math/schlath/schlather.html
Schlather, M. and Huwe, B. (2006) Modelling inhomogeneous soils:
Theory. In preparation.
Stoyan, D., Kendall, W.S., Mecke, J. (1995)
Stochastic Geometry and its Applications Chichester: Wiley, 2nd
edition.
RSA model (also called SSI process in stochastic geometry)
## get a standard definition first
h <- xswms2d(xlim=c(1, 100), ylim=c(1, 100), step=1, new=NULL)
h <- simulateHorizons(h)
h$H1$stone$lambda <- 0.002 ## in average 20 stones
h$H1$stone$no.overlap <- FALSE ## allow for overlapping stones
for (i in 1:5) {
plotRF(create.stones(h), what="Stone")
readline("Press return")
}