void Cell::SetCellCycleModel(AbstractCellCycleModel* pCellCycleModel) { if (mpCellCycleModel != pCellCycleModel) { delete mpCellCycleModel; } mpCellCycleModel = pCellCycleModel; mpCellCycleModel->SetCell(CellPtr(this, null_deleter())); }
void Cell::SetSrnModel(AbstractSrnModel* pSrnModel) { if (mpSrnModel != pSrnModel) { delete mpSrnModel; } mpSrnModel = pSrnModel; mpSrnModel->SetCell(CellPtr(this, null_deleter())); }
void MulRk::readFields(CFRecord& record) { global_info_ = record.getGlobalWorkbookInfo(); // A little hack to extract colLast before it is used record.skipNunBytes(record.getDataSize() - sizeof(unsigned short)); record >> colLast; record.resetPointerToBegin(); //------------------ record >> rw >> colFirst; for(unsigned short i = colFirst; i <= colLast; ++i) { RkRec rec; record >> rec; rgrkrec.push_back(RkRecPtr(new RkRec(rec))); cells.push_back(CellPtr(new Cell(rw, i, rec.get_ixfe()))); } record.skipNunBytes(sizeof(unsigned short)); }
Cell::Cell(boost::shared_ptr<AbstractCellProperty> pMutationState, AbstractCellCycleModel* pCellCycleModel, bool archiving, CellPropertyCollection cellPropertyCollection) : mCanDivide(false), mCellPropertyCollection(cellPropertyCollection), mpCellCycleModel(pCellCycleModel), mDeathTime(DBL_MAX), // This has to be initialised for archiving mStartOfApoptosisTime(DBL_MAX), mApoptosisTime(0.25), // cell takes 15 min to fully undergo apoptosis mUndergoingApoptosis(false), mIsDead(false), mIsLogged(false) { if (SimulationTime::Instance()->IsStartTimeSetUp()==false) { EXCEPTION("Cell is setting up a cell-cycle model but SimulationTime has not been set up"); } if (pCellCycleModel == NULL) { EXCEPTION("Cell-cycle model is null"); } mpCellCycleModel->SetCell(CellPtr(this, null_deleter())); if (!mCellPropertyCollection.HasPropertyType<CellId>()) { // Set cell identifier this will be called all the time unless the constructor is called through archiving MAKE_PTR(CellId, p_cell_id); p_cell_id->AssignCellId(); mCellPropertyCollection.AddProperty(p_cell_id); } if (!pMutationState->IsSubType<AbstractCellMutationState>()) { EXCEPTION("Attempting to create cell with a cell mutation state that is not a subtype of AbstractCellMutationState"); } if (!mCellPropertyCollection.HasProperty(pMutationState)) { mCellPropertyCollection.AddProperty(pMutationState); } if (!mCellPropertyCollection.HasPropertyType<CellData>()) { // Add empty cell data MAKE_PTR(CellData, p_cell_data); mCellPropertyCollection.AddProperty(p_cell_data); } /* * If a cell proliferative type was not passed in via the input * argument cellPropertyCollection (for example as in the case * of a daughter cell being created following division) then add * add a 'default' cell proliferative type to the cell property * collection. This ensures that the method GetCellProliferativeType() * always returns a valid proliferative type. */ if (!mCellPropertyCollection.HasPropertyType<AbstractCellProliferativeType>()) { mCellPropertyCollection.AddProperty(CellPropertyRegistry::Instance()->Get<DefaultCellProliferativeType>()); } if (!archiving) { // Increment cell count for each cell property in mCellPropertyCollection for (CellPropertyCollection::Iterator property_iter = mCellPropertyCollection.Begin(); property_iter != mCellPropertyCollection.End(); ++property_iter) { (*property_iter)->IncrementCellCount(); } } }
CellPtr make_cell(ExprPtr car, ExprPtr cdr) { return CellPtr(new Cell(car, cdr)); }