This model creates a grid of 4x4x4 cells. Each cell grows untill a specific volume, after which it proliferates (i.e. divides).
%jsroot on
gROOT->LoadMacro("${BDMSYS}/etc/binder_rootlogon.C");
Create a new simulation
Simulation simulation("cell_division");
Let's define the number of cells we wish to create along each dimension, the spacing between the cells, and each cell's diameter.
size_t cells_per_dim = 4;
size_t spacing = 20;
size_t diameter = 10;
To define how are cells will look like we will create a construct in the form of a C++ lambda as follows.
auto construct = [&](const Double3& position) {
Cell* cell = new Cell(position);
cell->SetDiameter(diameter);
// Add the "grow and divide" behavior to each cell
cell->AddBiologyModule(new GrowDivide());
return cell;
};
ModelInitializer::Grid3D(cells_per_dim, spacing, construct);
Run simulation for one timestep
simulation.Simulate(1);
std::cout << "Simulation completed successfully!" << std::endl;
Let's visualize the output!
VisualizeInNotebook();