frag.simul.process {archeofrag}R Documentation

Simulate the fragmentation of archaeological objects scattered in two stratigraphic layers

Description

Simulate the fragmentation of archaeological objects scattered in two stratigraphic layers (or any other kind of spatial unit).

Usage

frag.simul.process(initial.layers=2, n.components, vertices=Inf,
                   edges=Inf, balance=.5, components.balance=.5,
                   disturbance=0, aggreg.factor=0, planar=FALSE,
                   asymmetric.transport.from=NULL, 
                   from.observed.graph=NULL, observed.layer.attr=NULL)

Arguments

initial.layers

Integer (1 or 2). Number of hypothetical stratigraphic layers to use as initial condition.

n.components

Integer. Number of objects to fragment (connected components).

vertices

Integer. Number of fragments (vertices).

edges

Integer. Number of connection relationships between fragments (edges).

balance

Numeric ]0;1[. Proportion of fragments to generate in the first layer before applying disturbances.

components.balance

Numeric ]0;1[. Proportion of components in the first layer before applying fragmentation (only used when initial.layers=2).

disturbance

Numeric [0;1]. Proportion of fragments to randomly move from one layer to another.

aggreg.factor

Numeric [0;1]. Higher values increase the likelihood that the biggest components are selected when adding fragments or connections.

planar

Logical. If TRUE, generates a planar graph (if FALSE, the graph can be planar or not).

asymmetric.transport.from

Numeric or character value in "1" or "2". If not NULL, the disturbance process will be applied only to the fragments from this layer.

from.observed.graph

igraph object. If not NULL, the parameters observed in this fragmentation graph are used instead of the previous parameters. See details.

observed.layer.attr

character. Required if the from.observed.graph option is used. Name of the layer attribute in the observed graph.

Details

This function simulates the fragmentation of archeological objects within and between two adjacent stratigraphic layers. Fragments are represented by vertices and the "connection" relationships ("refittings") between them are represented by edges. All fragments have at least one relation ("single" fragments are not generated).

Some parameters are optional or depend on other parameters (messages are displayed accordingly). Namely, setting initial.layers=1 enables to constraint the graph with the number of vertices only, the number of edges only, or both. With initial.layers=2, the components.balance can be used, and the edges parameter is not supported (only the vertices parameter can be used).

The components.balance parameter determines the proportion of components (i.e. objects) in the first layer before the application of the fragmentation process; the balance parameter determines the proportion of fragments in the first layer before the application of the disturbance process. The disturbance parameter determines the proportion of fragments to "move" from one layer to another. Consequently, it generates inter-layer relationships. If asymmetric.transport.from is set to 1 or 2, the disturbance process is only applied to the fragments from layer 1 or layer 2, respectively.s

If a graph is given to the from.observed.graph parameter, the properties of this graph are internally retrieved with the frag.get.parameters function (including: the number of components, number of vertices, balance, the components.balance, the disturbance, the aggregation factor, and whether the graph is planar or not; note that the number of edges is not included as a parameter). If some other parameters of the frag.simul.process function are set, the values retrieved from the observed graph are used in replacement. The frag.edges.weighting is internally applied to weight the graph edges.

Setting the planar argument to TRUE constraints the graph to be planar (if this parameter is FALSE, the graph can be planar or not). Note that using the planar argument requires to install the optional RBGL package and that the simulator is faster with initial.layers=2 and planar=FALSE.

Value

An igraph object with a "frag_type" graph attribute (with the value "cr", for "connection relationship") and three vertices attributes: "name" (vertices identifiers), "layer" (with the values "1" and "2"), and "object.id" (component identifiers).

Author(s)

Sebastien Plutniak <sebastien.plutniak at posteo.net>

See Also

frag.get.parameters, frag.edges.weighting, boyerMyrvoldPlanarityTest

Examples

frag.simul.process(n.components=20, vertices=50, disturbance=.15)

g <- frag.simul.process(initial.layers=1, 
                            n.components=20,
                            vertices=50,
                            edges=40,
                            balance=.5,
                            components.balance=.5,
                            disturbance=.1,
                            planar=FALSE)
plot(g, vertex.color=factor(igraph::V(g)$layer), 
     vertex.size=4, vertex.label=NA)


[Package archeofrag version 0.8.2 Index]