Skip to contents

This method returns a dataframe reporting the current number of simulated events per species.

Value

A dataframe reporting event, mutant, epistate, and fired

for each event type, mutant, and epigenetic states.

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$run_up_to_event("switch", "A+", 100)
#> 
 [█---------------------------------------] 0% [00m:00s] Saving snapshot                                      

 [█---------------------------------------] 0% [00m:00s] Cells: 0                                             

 [█---------------------------------------] 0% [00m:00s] Cells: 0                                             

 [█---------------------------------------] 0% [00m:00s] Cells: 0                                             


# get the number of event fired per event and species
sim$get_firings()
#>    event mutant epistate fired
#> 1  death      A        -     0
#> 2 growth      A        -     0
#> 3 switch      A        -     0
#> 4  death      A        +     2
#> 5 growth      A        +     1
#> 6 switch      A        +     0