This method builds a simulation status variable.
Arguments
- variable_description
The description of the variable to be built. When
variable_description
is the string"Time"
, the elapsed simulation time variable is returned. Ifvariable_description
is set to a species name, then the variable representing the cardinality of the species is built. Finally, when the parameter is a species name followed by.
and one amongduplications
,deaths
, orswitches
, the variable representing the number of event of the specified type occurred since the computation beginning in the species.
Value
A variable representing the simulation quantity according to
the parameter variable_description
.
Details
This method builds a logic variable representing one of the simulation quantities among:
cardinality of a species
number of event among duplications, deaths, and epigenetic switches
elapsed evolution time
See also
Simulation
, SpatialSimulation$run_until()
Examples
# build a simulation and add two species to it
# set the seed of the random number generator
set.seed(0)
# create a simulation
sim <- SpatialSimulation()
sim$add_mutant(name = "A",
epigenetic_rates = c("+-" = 0.01, "-+" = 0.01),
growth_rates = c("+" = 0.2, "-" = 0.08),
death_rates = c("+" = 0.1, "-" = 0.01))
# get the variable representing the simulation time
sim$var("Time")
#> Time
# get the variable representing the cardinality of A+
sim$var("A+")
#> |A+|
# get the variable representing the cardinality of A-
sim$var("A-")
#> |A-|
# get the variable representing the number of epigenetic
# switches from A+
sim$var("A+.switches")
#> |A+.switches|
# get the variable representing the number of duplications
# in A+
sim$var("A+.duplications")
#> |A+.duplications|
# get the variable representing the number of deaths in A+
sim$var("A+.deaths")
#> |A+.deaths|