From a simulation object, this function samples bounding boxes of a custom size until a number of cells of a certain species are not sampled. If this never happens, after a fixed number of attempts the best box is returned.
Examples
sim <- TissueSimulation()
sim$add_mutant(name = "A", growth_rates = 0.08, death_rates = 0.01)
sim$place_cell("A", 500, 500)
sim$run_up_to_size("A", 25000)
#>
[████████████████████████████████████████] 100% [00m:00s] Saving snapshot
bbox <- bbox_sampler(sim, "A", n = 2500, n_w = 50, n_h = 50)
sim$sample_cells("A", bbox$p, bbox$q)
plot_tissue(sim)
