tumopp: Tumor growth simulator in C++
tumopp::Tissue Class Reference

Population of Cell. More...

#include <tissue.hpp>

Classes

struct  hash_ptr_cell
 Hashing function object for shared_pointer<Cell>. More...
struct  equal_ptr_cell
 Equal function object for shared_pointer<Cell>. More...

Public Member Functions

 Tissue (ptrdiff_t initial_size=1, int dimensions=3, const std::string &coordinate="moore", const std::string &local_density_effect="const", const std::string &displacement_path="random", const EventRates &init_event_rates=EventRates{}, uint32_t seed=std::random_device{}(), bool verbose=false, bool enable_benchmark=false)
 Constructor.
bool grow (ptrdiff_t max_size, double max_time=100.0, double snapshot_interval=0.0, ptrdiff_t recording_early_growth=0, ptrdiff_t mutation_timing=0)
 main function
void plateau (double time)
 Simulate turnover with the increased death_rate.
void treatment (double death_prob, ptrdiff_t num_resistant_cells=3)
 Simulate medical treatment with the increased death_prob.
void benchmark_append (const ptrdiff_t size)
 Append current state to benchmark_.
std::string str_history () const
 Write extant_cells_ and their ancestors.
std::string str_snapshots () const
 Write snapshots_.
std::string str_drivers () const
 Write drivers_.
std::string_view str_benchmark () const
 View benchmark_.

Friends

std::string format_as (const Tissue &x)
 Write all extant cells.

Getter functions

std::function< bool(const std::shared_ptr< Cell > &)> insert
 initialized in init_insert_function()
std::unordered_set< std::shared_ptr< Cell >, hash_ptr_cell, equal_ptr_cellextant_cells_ {}
 cells
int id_tail_ {0}
 incremented when a new cell is born
std::multimap< double, std::shared_ptr< Cell > > queue_ {}
 event queue
double time_ {0.0}
 continuous time
std::unique_ptr< Coordcoord_func_ {nullptr}
 initialized in init_coord() or init_coord_test()
std::string cemetery_ {}
 record dead cells
std::string snapshots_ {}
 record snapshots
std::string drivers_ {}
 record driver mutations
std::unordered_set< int > recorded_ {}
 id of recorded cells
std::string benchmark_ {}
 record resource usage
std::unique_ptr< urbg_t > engine_ {nullptr}
 random number generator
bool verbose_ {false}
 print debug info
size_t size () const noexcept
 Get the number of extant cells.
void init_coord (int dimensions, const std::string &coordinate)
 Set coord_func_.
void init_insert_function (const std::string &local_density_effect, const std::string &displacement_path)
 Set insert function.
void migrate (const std::shared_ptr< Cell > &)
 Swap with a random neighbor.
void push (std::shared_ptr< Cell > moving, const coord_t &direction)
 Emplace daughter cell and push other cells to the direction.
void push_minimum_drag (std::shared_ptr< Cell > moving)
 Push through the minimum drag path.
void stroll (std::shared_ptr< Cell > moving, const coord_t &direction)
 Try insert_adjacent() on every step in push().
bool insert_adjacent (const std::shared_ptr< Cell > &x)
 Insert x if any adjacent node is empty.
bool swap_existing (std::shared_ptr< Cell > *x)
 Put new cell and return existing.
ptrdiff_t steps_to_empty (const coord_t &current, const coord_t &direction) const
 Count steps to the nearest empty.
const coord_t & to_nearest_empty (const coord_t &current) const
 Direction to the nearest empty.
coord_t roulette_direction (const coord_t &current) const
 Direction is selected with a probability proportional with 1/l.
int_fast8_t num_empty_neighbors (const coord_t &) const
 Count adjacent empty sites.
double positional_value (const coord_t &) const
 TODO: Calculate positional value.
void queue_push (const std::shared_ptr< Cell > &, bool surrounded=false)
 Push a cell to event queue_.
void entomb (const std::shared_ptr< Cell > &)
 Put a cell to cemetery_.
void snapshots_append ()
 Write all cells to snapshots_ with time_.

Detailed Description

Population of Cell.


The documentation for this class was generated from the following files: