00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2010 00004 00005 University of Oxford means the Chancellor, Masters and Scholars of the 00006 University of Oxford, having an administrative office at Wellington 00007 Square, Oxford OX1 2JD, UK. 00008 00009 This file is part of Chaste. 00010 00011 Chaste is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU Lesser General Public License as published 00013 by the Free Software Foundation, either version 2.1 of the License, or 00014 (at your option) any later version. 00015 00016 Chaste is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00019 License for more details. The offer of Chaste under the terms of the 00020 License is subject to the License being interpreted in accordance with 00021 English Law and subject to any action against the University of Oxford 00022 being under the jurisdiction of the English Courts. 00023 00024 You should have received a copy of the GNU Lesser General Public License 00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>. 00026 00027 */ 00028 #ifndef ABSTRACTCELLCYCLEMODEL_HPP_ 00029 #define ABSTRACTCELLCYCLEMODEL_HPP_ 00030 00031 #include "ChasteSerialization.hpp" 00032 #include "ClassIsAbstract.hpp" 00033 #include <boost/serialization/base_object.hpp> 00034 00035 #include <vector> 00036 00037 #include "CellProliferativeTypes.hpp" 00038 #include "CellCyclePhases.hpp" 00039 #include "SimulationTime.hpp" 00040 #include "Cell.hpp" 00041 00042 class Cell; // Circular definition (cells need to know about cycle models and vice-versa) 00043 typedef boost::shared_ptr<Cell> CellPtr; 00044 00051 class AbstractCellCycleModel : boost::noncopyable 00052 { 00053 private: 00054 00056 friend class boost::serialization::access; 00068 template<class Archive> 00069 void serialize(Archive & archive, const unsigned int version) 00070 { 00071 // Make sure the SimulationTime singleton gets saved too 00072 SimulationTime* p_time = SimulationTime::Instance(); 00073 archive & *p_time; 00074 archive & p_time; 00075 00076 // DO NOT archive & mpCell; -- The CellCycleModel is only ever archived from the Cell 00077 // which knows this and it is handled in the load_construct of Cell. 00078 archive & mBirthTime; 00079 archive & mCurrentCellCyclePhase; 00080 archive & mG1Duration; 00081 archive & mReadyToDivide; 00082 archive & mDimension; 00083 archive & mCellProliferativeType; 00084 archive & mMinimumGapDuration; 00085 archive & mStemCellG1Duration; 00086 archive & mTransitCellG1Duration; 00087 archive & mSDuration; 00088 archive & mG2Duration; 00089 archive & mMDuration; 00090 } 00091 00092 protected: 00093 00095 CellPtr mpCell; 00096 00101 double mBirthTime; 00102 00104 CellCyclePhase mCurrentCellCyclePhase; 00105 00110 double mG1Duration; 00111 00115 bool mReadyToDivide; 00116 00120 unsigned mDimension; 00121 00125 CellProliferativeType mCellProliferativeType; 00126 00134 double mMinimumGapDuration; 00135 00141 double mStemCellG1Duration; 00142 00147 double mTransitCellG1Duration; 00148 00152 double mSDuration; 00153 00157 double mG2Duration; 00158 00162 double mMDuration; 00163 00164 00165 public: 00166 00171 AbstractCellCycleModel(); 00172 00178 virtual ~AbstractCellCycleModel(); 00179 00189 void SetCell(CellPtr pCell); 00190 00202 virtual void Initialise(); 00203 00216 virtual void InitialiseDaughterCell(); 00217 00221 CellPtr GetCell(); 00222 00231 virtual void SetBirthTime(double birthTime); 00232 00238 void SetDimension(unsigned dimension); 00239 00243 unsigned GetDimension(); 00244 00248 double GetBirthTime() const; 00249 00253 double GetAge(); 00254 00263 virtual bool ReadyToDivide(); 00264 00271 virtual void UpdateCellCyclePhase()=0; 00272 00281 virtual void ResetForDivision(); 00282 00295 virtual AbstractCellCycleModel* CreateCellCycleModel()=0; 00296 00300 CellCyclePhase GetCurrentCellCyclePhase(); 00301 00305 virtual double GetG1Duration(); 00306 00310 double GetStemCellG1Duration(); 00311 00315 double GetTransitCellG1Duration(); 00316 00320 double GetSG2MDuration(); 00321 00325 virtual double GetSDuration(); 00326 00330 virtual double GetG2Duration(); 00331 00335 virtual double GetMDuration(); 00336 00342 void SetStemCellG1Duration(double stemCellG1Duration); 00343 00349 void SetTransitCellG1Duration(double transitCellG1Duration); 00350 00356 void SetSDuration(double sDuration); 00357 00363 void SetG2Duration(double g2Duration); 00364 00370 void SetMDuration(double mDuration); 00371 00376 virtual double GetAverageTransitCellCycleTime(); 00377 00382 virtual double GetAverageStemCellCycleTime(); 00383 00387 virtual bool CanCellTerminallyDifferentiate(); 00388 00392 CellProliferativeType GetCellProliferativeType() const; 00393 00399 void SetCellProliferativeType(CellProliferativeType cellType); 00400 00404 double GetMinimumGapDuration(); 00405 00411 void SetMinimumGapDuration(double minimumGapDuration); 00412 }; 00413 00414 CLASS_IS_ABSTRACT(AbstractCellCycleModel) 00415 00416 #endif /*ABSTRACTCELLCYCLEMODEL_HPP_*/