36 #ifndef CRYPTCELLSGENERATOR_HPP_
37 #define CRYPTCELLSGENERATOR_HPP_
39 #include <boost/mpl/integral_c.hpp>
40 #include <boost/type_traits/is_same.hpp>
41 #include <boost/mpl/if.hpp>
43 #include "CellsGenerator.hpp"
45 #include "CellPropertyRegistry.hpp"
46 #include "TetrahedralMesh.hpp"
47 #include "VertexMesh.hpp"
48 #include "PottsMesh.hpp"
50 #include "UniformG1GenerationalCellCycleModel.hpp"
51 #include "FixedG1GenerationalCellCycleModel.hpp"
52 #include "TysonNovakCellCycleModel.hpp"
53 #include "WntCellCycleModel.hpp"
54 #include "SimpleWntCellCycleModel.hpp"
55 #include "StochasticWntCellCycleModel.hpp"
56 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisOne.hpp"
57 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisTwo.hpp"
59 #include "StemCellProliferativeType.hpp"
60 #include "TransitCellProliferativeType.hpp"
61 #include "DifferentiatedCellProliferativeType.hpp"
68 template<
class T1,
class T2>
71 using namespace boost::mpl;
72 using namespace boost;
73 typedef typename if_< is_same<T1, T2>, integral_c<unsigned, 1>, integral_c<unsigned, 0> >::type selector_t;
74 return (selector_t()==1);
82 template<
class CELL_CYCLE_MODEL>
104 void Generate(std::vector<CellPtr>& rCells,
106 const std::vector<unsigned> locationIndices,
107 bool randomBirthTimes,
112 bool initialiseCells =
false);
115 template<
class CELL_CYCLE_MODEL>
117 std::vector<CellPtr>& rCells,
119 const std::vector<unsigned> locationIndices,
120 bool randomBirthTimes,
125 bool initialiseCells)
135 unsigned num_cells = locationIndices.empty() ? pMesh->
GetNumNodes() : locationIndices.size();
136 rCells.reserve(num_cells);
140 mesh_size =
static_cast<PottsMesh<2>*
>(pMesh)->GetNumElements();
141 rCells.reserve(mesh_size);
148 rCells.reserve(mesh_size);
154 for (
unsigned i=0; i<mesh_size; i++)
160 if (locationIndices.empty())
162 y = pMesh->
GetNode(i)->GetPoint().rGetLocation()[1];
165 else if (std::find(locationIndices.begin(), locationIndices.end(), i) != locationIndices.end())
167 y = pMesh->
GetNode(i)->GetPoint().rGetLocation()[1];
172 y =
static_cast<PottsMesh<2>*
>(pMesh)->GetCentroidOfElement(i)[1];
182 CELL_CYCLE_MODEL* p_cell_cycle_model =
new CELL_CYCLE_MODEL;
183 p_cell_cycle_model->SetDimension(2);
185 double typical_transit_cycle_time = p_cell_cycle_model->GetAverageTransitCellCycleTime();
186 double typical_stem_cycle_time = p_cell_cycle_model->GetAverageStemCellCycleTime();
188 double birth_time = 0.0;
189 if (randomBirthTimes)
191 birth_time = -p_random_num_gen->
ranf();
195 unsigned generation = 4;
212 if (dynamic_cast<AbstractSimpleGenerationalCellCycleModel*>(p_cell_cycle_model))
218 CellPtr p_cell(
new Cell(p_state, p_cell_cycle_model));
228 if (y >= y3 && p_cell_cycle_model->CanCellTerminallyDifferentiate())
237 p_cell->InitialiseCellCycleModel();
243 birth_time *= typical_stem_cycle_time;
247 birth_time *= typical_transit_cycle_time;
249 p_cell->SetBirthTime(birth_time);
251 if (locationIndices.empty())
253 rCells.push_back(p_cell);
255 else if (std::find(locationIndices.begin(), locationIndices.end(), i) != locationIndices.end())
257 rCells.push_back(p_cell);
void Generate(std::vector< CellPtr > &rCells, AbstractMesh< 2, 2 > *pMesh, const std::vector< unsigned > locationIndices, bool randomBirthTimes, double y0=0.3, double y1=2.0, double y2=3.0, double y3=4.0, bool initialiseCells=false)
Node< SPACE_DIM > * GetNode(unsigned index) const
virtual unsigned GetNumNodes() const
static CellPropertyRegistry * Instance()
static RandomNumberGenerator * Instance()