Skip to contents

This method returns the cells manually added to the simulation.

Value

A dataframe reporting mutant, epistate, position_x, position_y, and time for each cells manually added to the simulation.

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$add_mutant(name = "B",
               epigenetic_rates = c("+-" = 0.02, "-+" = 0.01),
               growth_rates = c("+" = 0.3, "-" = 0.1),
               death_rates = c("+" = 0.1, "-" = 0.01))
sim$schedule_mutation(src = "A", dst = "B", time = 30)
sim$place_cell("A+", 500, 500)
sim$run_up_to_time(50)
#> 
 [████████████████████████████████████████] 100% [00m:00s] Saving snapshot                                 


# counts the number of cells per species
sim$get_added_cells()
#>   mutant epistate position_x position_y time
#> 1      A        +        500        500    0