Getting the fired event history
Source:R/RcppExports.R
SpatialSimulation-cash-get_firing_history.Rd
This method returns a dataframe reporting the number of events fired up to each sampled simulation time.
Value
A dataframe reporting event
, mutant
, epistate
, fired
,
and time
for each event type, for each species, and for each
sampled time.
Examples
# 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))
sim$place_cell("A+", 500, 500)
sim$history_delta <- 20
sim$run_up_to_time(70)
#>
[████████████████████████████████████████] 100% [00m:00s] Saving snapshot
# get the number of event fired per event and species
sim$get_firing_history()
#> event mutant epistate fired time
#> 1 death A - 1 20.00000
#> 2 growth A - 7 20.00000
#> 3 switch A - 0 20.00000
#> 4 death A + 5 20.00000
#> 5 growth A + 8 20.00000
#> 6 switch A + 3 20.00000
#> 7 death A - 5 40.00000
#> 8 growth A - 37 40.00000
#> 9 switch A - 5 40.00000
#> 10 death A + 8 40.00000
#> 11 growth A + 15 40.00000
#> 12 switch A + 3 40.00000
#> 13 death A - 18 60.00000
#> 14 growth A - 91 60.00000
#> 15 switch A - 14 60.00000
#> 16 death A + 63 60.00000
#> 17 growth A + 105 60.00000
#> 18 switch A + 7 60.00000
#> 19 death A - 25 70.00287
#> 20 growth A - 151 70.00287
#> 21 switch A - 24 70.00287
#> 22 death A + 129 70.00287
#> 23 growth A + 239 70.00287
#> 24 switch A + 10 70.00287