38 #include "ApoptoticCellProperty.hpp"
39 #include "CellAncestor.hpp"
41 #include "CellLabel.hpp"
42 #include "DefaultCellProliferativeType.hpp"
43 #include "NullSrnModel.hpp"
46 Cell::Cell(boost::shared_ptr<AbstractCellProperty> pMutationState,
52 mCellPropertyCollection(cellPropertyCollection),
53 mpCellCycleModel(pCellCycleModel),
54 mpSrnModel(pSrnModel),
56 mStartOfApoptosisTime(DBL_MAX),
58 mUndergoingApoptosis(false),
64 EXCEPTION(
"Cell is setting up a cell-cycle model but SimulationTime has not been set up");
67 if (pCellCycleModel ==
nullptr)
75 if (pSrnModel ==
nullptr)
87 p_cell_id->AssignCellId();
93 EXCEPTION(
"Attempting to create cell with a cell mutation state that is not a subtype of AbstractCellMutationState");
128 (*property_iter)->IncrementCellCount();
147 EXCEPTION(
"Attempting to give cell a cell proliferative type that is not a subtype of AbstractCellProliferativeType");
152 p_old_proliferative_type->DecrementCellCount();
168 assert(proliferative_type_collection.
GetSize() == 1);
232 EXCEPTION(
"Attempting to give cell a cell mutation state that is not a subtype of AbstractCellMutationState");
235 boost::shared_ptr<AbstractCellMutationState> p_old_mutation_state =
GetMutationState();
236 p_old_mutation_state->DecrementCellCount();
252 assert(mutation_state_collection.
GetSize() == 1);
265 assert(cell_data_collection.
GetSize() <= 1);
285 assert(cell_data_collection.
GetSize() <= 1);
306 rProperty->IncrementCellCount();
326 EXCEPTION(
"StartApoptosis() called when already undergoing apoptosis");
358 assert(apoptosisTime > 0.0);
366 EXCEPTION(
"Shouldn't be checking time until apoptosis as it isn't set");
392 (*property_iter)->DecrementCellCount();
401 EXCEPTION(
"Attempting to give cell a cell ancestor which is not a CellAncestor");
406 if (ancestor_collection.
GetSize() == 0)
413 RemoveCellProperty<CellAncestor>();
422 assert(ancestor_collection.
GetSize() <= 1);
423 if (ancestor_collection.
GetSize() == 0)
428 boost::shared_ptr<CellAncestor> p_ancestor = boost::static_pointer_cast<
CellAncestor>(ancestor_collection.
GetProperty());
437 assert(cell_id_collection.
GetSize() == 1);
439 boost::shared_ptr<CellId> p_cell_id = boost::static_pointer_cast<
CellId>(cell_id_collection.
GetProperty());
481 boost::shared_ptr<CellData> p_cell_data =
GetCellData();
486 daughter_property_collection.
AddProperty(p_daughter_cell_data);
492 boost::shared_ptr<CellVecData> p_cell_vec_data =
GetCellVecData();
497 daughter_property_collection.
AddProperty(p_daughter_cell_vec_data);
504 p_new_cell->GetCellCycleModel()->InitialiseDaughterCell();
505 p_new_cell->GetSrnModel()->InitialiseDaughterCell();
void InitialiseSrnModel()
AbstractCellCycleModel * GetCellCycleModel() const
virtual void SetBirthTime(double birthTime)
double GetBirthTime() const
double GetTimeUntilDeath() const
void InitialiseCellCycleModel()
void SetCellCycleModel(AbstractCellCycleModel *pCellCycleModel)
CollectionType::iterator Iterator
boost::shared_ptr< AbstractCellProperty > GetProperty() const
#define EXCEPTION(message)
static SimulationTime * Instance()
AbstractSrnModel * mpSrnModel
double GetStartOfApoptosisTime() const
CellPropertyCollection GetPropertiesType() const
unsigned GetAncestor() const
bool HasPropertyType() const
boost::shared_ptr< AbstractCellProliferativeType > GetCellProliferativeType() const
void AddCellProperty(const boost::shared_ptr< AbstractCellProperty > &rProperty)
void SetCell(CellPtr pCell)
void SetCell(CellPtr pCell)
void SetApoptosisTime(double apoptosisTime)
virtual bool ReadyToDivide()=0
static CellPropertyRegistry * Instance()
virtual void SimulateToCurrentTime()=0
unsigned GetCellId() const
#define MAKE_PTR(TYPE, NAME)
boost::shared_ptr< CellVecData > GetCellVecData() const
virtual void ResetForDivision()
virtual AbstractSrnModel * CreateSrnModel()=0
bool mUndergoingApoptosis
virtual void Initialise()
double GetApoptosisTime() const
CellPropertyCollection & rGetCellPropertyCollection()
void SetCellProliferativeType(boost::shared_ptr< AbstractCellProperty > pProliferativeType)
bool HasApoptosisBegun() const
AbstractCellCycleModel * mpCellCycleModel
boost::shared_ptr< AbstractCellProperty > Get()
const unsigned UNSIGNED_UNSET
AbstractSrnModel * GetSrnModel() const
void StartApoptosis(bool setDeathTime=true)
bool HasProperty(const boost::shared_ptr< AbstractCellProperty > &rProp) const
void AddProperty(const boost::shared_ptr< AbstractCellProperty > &rProp)
bool HasCellVecData() const
double GetBirthTime() const
virtual void ResetForDivision()
CellPropertyRegistry * GetCellPropertyRegistry()
unsigned GetCellId() const
CellPropertyCollection mCellPropertyCollection
boost::shared_ptr< CellData > GetCellData() const
void SetMutationState(boost::shared_ptr< AbstractCellProperty > pMutationState)
unsigned GetAncestor() const
void SetBirthTime(double birthTime)
Cell(boost::shared_ptr< AbstractCellProperty > pMutationState, AbstractCellCycleModel *pCellCycleModel, AbstractSrnModel *pSrnModel=nullptr, bool archiving=false, CellPropertyCollection cellPropertyCollection=CellPropertyCollection())
void SetAncestor(boost::shared_ptr< AbstractCellProperty > pCellAncestor)
void SetSrnModel(AbstractSrnModel *pSrnModel)
double mStartOfApoptosisTime
virtual AbstractCellCycleModel * CreateCellCycleModel()=0
virtual void Initialise()
#define MAKE_PTR_ARGS(TYPE, NAME, ARGS)
boost::shared_ptr< AbstractCellMutationState > GetMutationState() const