36 #ifndef CELLSGENERATOR_HPP_ 37 #define CELLSGENERATOR_HPP_ 41 #include "WildTypeCellMutationState.hpp" 42 #include "StemCellProliferativeType.hpp" 43 #include "TransitCellProliferativeType.hpp" 44 #include "RandomNumberGenerator.hpp" 51 template<
class CELL_CYCLE_MODEL,
unsigned DIM>
69 const std::vector<unsigned> locationIndices=std::vector<unsigned>(),
70 boost::shared_ptr<AbstractCellProperty> pCellProliferativeType=boost::shared_ptr<AbstractCellProperty>());
83 boost::shared_ptr<AbstractCellProperty> pCellProliferativeType=boost::shared_ptr<AbstractCellProperty>());
93 const std::vector<unsigned> locationIndices,
94 boost::shared_ptr<AbstractCellProperty> pCellProliferativeType=boost::shared_ptr<AbstractCellProperty>());
97 template<
class CELL_CYCLE_MODEL,
unsigned DIM>
100 const std::vector<unsigned> locationIndices,
101 boost::shared_ptr<AbstractCellProperty> pCellProliferativeType)
105 if (!locationIndices.empty())
108 if (numCells != locationIndices.size())
110 EXCEPTION(
"The size of the locationIndices vector must match the required number of output cells");
113 rCells.reserve(numCells);
116 for (
unsigned i=0; i<numCells; i++)
118 CELL_CYCLE_MODEL* p_cell_cycle_model =
new CELL_CYCLE_MODEL;
119 p_cell_cycle_model->SetDimension(DIM);
122 CellPtr p_cell(
new Cell(p_state, p_cell_cycle_model));
124 if (!pCellProliferativeType)
130 p_cell->SetCellProliferativeType(pCellProliferativeType);
134 if (!locationIndices.empty())
136 birth_time = 0.0 - locationIndices[i];
140 birth_time = 0.0 - i;
143 p_cell->SetBirthTime(birth_time);
144 rCells.push_back(p_cell);
148 template<
class CELL_CYCLE_MODEL,
unsigned DIM>
151 boost::shared_ptr<AbstractCellProperty> pCellProliferativeType)
155 rCells.reserve(numCells);
158 for (
unsigned i=0; i<numCells; i++)
160 CELL_CYCLE_MODEL* p_cell_cycle_model =
new CELL_CYCLE_MODEL;
161 p_cell_cycle_model->SetDimension(DIM);
164 CellPtr p_cell(
new Cell(p_state, p_cell_cycle_model));
166 if (!pCellProliferativeType)
172 p_cell->SetCellProliferativeType(pCellProliferativeType);
182 p_cell->SetBirthTime(birth_time);
183 rCells.push_back(p_cell);
187 template<
class CELL_CYCLE_MODEL,
unsigned DIM>
189 const std::vector<unsigned> locationIndices,
190 boost::shared_ptr<AbstractCellProperty> pCellProliferativeType)
192 assert(!locationIndices.empty());
194 unsigned num_cells = locationIndices.size();
197 rCells.reserve(num_cells);
200 for (
unsigned i=0; i<num_cells; i++)
202 CELL_CYCLE_MODEL* p_cell_cycle_model =
new CELL_CYCLE_MODEL;
203 p_cell_cycle_model->SetDimension(DIM);
207 CellPtr p_cell(
new Cell(p_state, p_cell_cycle_model));
209 if (!pCellProliferativeType)
215 p_cell->SetCellProliferativeType(pCellProliferativeType);
218 double birth_time = 0.0 - locationIndices[i];
219 p_cell->SetBirthTime(birth_time);
220 rCells.push_back(p_cell);
#define EXCEPTION(message)
void GenerateBasic(std::vector< CellPtr > &rCells, unsigned numCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), boost::shared_ptr< AbstractCellProperty > pCellProliferativeType=boost::shared_ptr< AbstractCellProperty >())
static CellPropertyRegistry * Instance()
static RandomNumberGenerator * Instance()
void GenerateBasicRandom(std::vector< CellPtr > &rCells, unsigned numCells, boost::shared_ptr< AbstractCellProperty > pCellProliferativeType=boost::shared_ptr< AbstractCellProperty >())
void GenerateGivenLocationIndices(std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices, boost::shared_ptr< AbstractCellProperty > pCellProliferativeType=boost::shared_ptr< AbstractCellProperty >())