39 #include "NullSrnModel.hpp"
61 Cell::Cell(boost::shared_ptr<AbstractCellProperty> pMutationState,
67 mCellPropertyCollection(cellPropertyCollection),
68 mpCellCycleModel(pCellCycleModel),
69 mpSrnModel(pSrnModel),
71 mStartOfApoptosisTime(DBL_MAX),
73 mUndergoingApoptosis(false),
79 EXCEPTION(
"Cell is setting up a cell-cycle model but SimulationTime has not been set up");
82 if (pCellCycleModel == NULL)
90 if (pSrnModel == NULL)
102 p_cell_id->AssignCellId();
108 EXCEPTION(
"Attempting to create cell with a cell mutation state that is not a subtype of AbstractCellMutationState");
143 (*property_iter)->IncrementCellCount();
162 EXCEPTION(
"Attempting to give cell a cell proliferative type that is not a subtype of AbstractCellProliferativeType");
167 p_old_proliferative_type->DecrementCellCount();
183 assert(proliferative_type_collection.
GetSize() == 1);
247 EXCEPTION(
"Attempting to give cell a cell mutation state that is not a subtype of AbstractCellMutationState");
250 boost::shared_ptr<AbstractCellMutationState> p_old_mutation_state =
GetMutationState();
251 p_old_mutation_state->DecrementCellCount();
267 assert(mutation_state_collection.
GetSize() == 1);
280 assert(cell_data_collection.
GetSize() <= 1);
300 assert(cell_data_collection.
GetSize() <= 1);
321 rProperty->IncrementCellCount();
341 EXCEPTION(
"StartApoptosis() called when already undergoing apoptosis");
373 assert(apoptosisTime > 0.0);
381 EXCEPTION(
"Shouldn't be checking time until apoptosis as it isn't set");
407 (*property_iter)->DecrementCellCount();
416 EXCEPTION(
"Attempting to give cell a cell ancestor which is not a CellAncestor");
421 if (ancestor_collection.
GetSize() == 0)
428 RemoveCellProperty<CellAncestor>();
437 assert(ancestor_collection.
GetSize() <= 1);
438 if (ancestor_collection.
GetSize() == 0)
443 boost::shared_ptr<CellAncestor> p_ancestor = boost::static_pointer_cast<
CellAncestor>(ancestor_collection.
GetProperty());
452 assert(cell_id_collection.
GetSize() == 1);
454 boost::shared_ptr<CellId> p_cell_id = boost::static_pointer_cast<
CellId>(cell_id_collection.
GetProperty());
496 boost::shared_ptr<CellData> p_cell_data =
GetCellData();
501 daughter_property_collection.
AddProperty(p_daughter_cell_data);
507 boost::shared_ptr<CellVecData> p_cell_vec_data =
GetCellVecData();
512 daughter_property_collection.
AddProperty(p_daughter_cell_vec_data);
519 p_new_cell->GetCellCycleModel()->InitialiseDaughterCell();
520 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 operator()(void const *) const
void AddCellProperty(const boost::shared_ptr< AbstractCellProperty > &rProperty)
void SetCell(CellPtr pCell)
void SetCell(CellPtr pCell)
void SetApoptosisTime(double apoptosisTime)
static CellPropertyRegistry * Instance()
virtual void SimulateToCurrentTime()=0
virtual bool ReadyToDivide()
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)
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)
Cell(boost::shared_ptr< AbstractCellProperty > pMutationState, AbstractCellCycleModel *pCellCycleModel, AbstractSrnModel *pSrnModel=NULL, bool archiving=false, CellPropertyCollection cellPropertyCollection=CellPropertyCollection())
boost::shared_ptr< AbstractCellMutationState > GetMutationState() const