Simulate the fragmentation of archaeological objects scattered in two spatial units.
frag.simul.process(initial.layers=2, n.components=NULL, 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,
verbose=TRUE)
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).
Integer (1 or 2). Number of hypothetical spatial units (e.g. layers) to use as initial condition.
Integer. Innitial number of objects (connected components).
Integer. Final number of fragments (vertices).
Integer. Final number of connection relationships between fragments (edges).
Numeric ]0;1[. Proportion of fragments to generate in the first spatial unit before applying disturbance.
Numeric ]0;1[. Proportion of objects (connected components) in the first spatial unit before applying fragmentation (only used when initial.layers=2).
Numeric [0;1]. Final proportion of fragments moved from a spatial unit to the other.
Numeric [0;1]. Higher values increase the likelihood that the biggest components are selected when adding fragments or connections.
Logical. If TRUE, generates a planar graph (if FALSE, the graph can be planar or not).
Numeric or character value in "1" or "2" (refering to the first and second spatial unit). If not NULL, the disturbance process will be applied only to the fragments from this spatial unit.
igraph object. If not NULL, the parameters observed in this fragmentation graph are used instead of the previous parameters. See details.
character. Required if the from.observed.graph
option is used. Name of the spatial unit attribute in the observed graph.
Logical. Whether to print or not warning messages.
Sebastien Plutniak <sebastien.plutniak at posteo.net>
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 spatial unit before the application of the fragmentation process;
the balance
parameter determines the proportion of fragments in the first spatial unit before the application of the disturbance process.
The disturbance
parameter determines the proportion of fragments to move from one spatial unit to another. Consequently, it generates inter-spatial units relationships. Highest admixture are generated with disturbance=0.5.
If asymmetric.transport.from
is set to 1 or 2, the disturbance process is only applied to the fragments from spatial unit 1 or spatial unit 2, respectively.
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.
frag.get.parameters
,
frag.edges.weighting
,
boyerMyrvoldPlanarityTest
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)
Run the code above in your browser using DataLab