00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2011 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 "Identifiable.hpp" 00034 00035 #include <boost/serialization/base_object.hpp> 00036 00037 #include <vector> 00038 00039 #include "OutputFileHandler.hpp" 00040 #include "CellProliferativeTypes.hpp" 00041 #include "CellCyclePhases.hpp" 00042 #include "SimulationTime.hpp" 00043 #include "Cell.hpp" 00044 00045 class Cell; // Circular definition (cells need to know about cycle models and vice-versa) 00046 typedef boost::shared_ptr<Cell> CellPtr; 00047 00054 class AbstractCellCycleModel : public Identifiable, boost::noncopyable 00055 { 00056 private: 00057 00059 friend class boost::serialization::access; 00071 template<class Archive> 00072 void serialize(Archive & archive, const unsigned int version) 00073 { 00074 // Make sure the SimulationTime singleton gets saved too 00075 SimulationTime* p_time = SimulationTime::Instance(); 00076 archive & *p_time; 00077 archive & p_time; 00078 00079 // DO NOT archive & mpCell; -- The CellCycleModel is only ever archived from the Cell 00080 // which knows this and it is handled in the load_construct of Cell. 00081 archive & mBirthTime; 00082 archive & mCurrentCellCyclePhase; 00083 archive & mG1Duration; 00084 archive & mReadyToDivide; 00085 archive & mDimension; 00086 archive & mCellProliferativeType; 00087 archive & mMinimumGapDuration; 00088 archive & mStemCellG1Duration; 00089 archive & mTransitCellG1Duration; 00090 archive & mSDuration; 00091 archive & mG2Duration; 00092 archive & mMDuration; 00093 } 00094 00095 protected: 00096 00098 CellPtr mpCell; 00099 00104 double mBirthTime; 00105 00107 CellCyclePhase mCurrentCellCyclePhase; 00108 00113 double mG1Duration; 00114 00118 bool mReadyToDivide; 00119 00123 unsigned mDimension; 00124 00128 CellProliferativeType mCellProliferativeType; 00129 00137 double mMinimumGapDuration; 00138 00144 double mStemCellG1Duration; 00145 00150 double mTransitCellG1Duration; 00151 00155 double mSDuration; 00156 00160 double mG2Duration; 00161 00165 double mMDuration; 00166 00167 public: 00168 00173 AbstractCellCycleModel(); 00174 00180 virtual ~AbstractCellCycleModel(); 00181 00191 void SetCell(CellPtr pCell); 00192 00204 virtual void Initialise(); 00205 00218 virtual void InitialiseDaughterCell(); 00219 00223 CellPtr GetCell(); 00224 00233 virtual void SetBirthTime(double birthTime); 00234 00240 void SetDimension(unsigned dimension); 00241 00245 unsigned GetDimension(); 00246 00250 double GetBirthTime() const; 00251 00255 double GetAge(); 00256 00265 virtual bool ReadyToDivide(); 00266 00273 virtual void UpdateCellCyclePhase()=0; 00274 00283 virtual void ResetForDivision(); 00284 00297 virtual AbstractCellCycleModel* CreateCellCycleModel()=0; 00298 00302 CellCyclePhase GetCurrentCellCyclePhase(); 00303 00307 virtual double GetG1Duration(); 00308 00312 double GetStemCellG1Duration(); 00313 00317 double GetTransitCellG1Duration(); 00318 00322 double GetSG2MDuration(); 00323 00327 virtual double GetSDuration(); 00328 00332 virtual double GetG2Duration(); 00333 00337 virtual double GetMDuration(); 00338 00344 void SetStemCellG1Duration(double stemCellG1Duration); 00345 00351 void SetTransitCellG1Duration(double transitCellG1Duration); 00352 00358 void SetSDuration(double sDuration); 00359 00365 void SetG2Duration(double g2Duration); 00366 00372 void SetMDuration(double mDuration); 00373 00378 virtual double GetAverageTransitCellCycleTime(); 00379 00384 virtual double GetAverageStemCellCycleTime(); 00385 00389 virtual bool CanCellTerminallyDifferentiate(); 00390 00394 CellProliferativeType GetCellProliferativeType() const; 00395 00401 void SetCellProliferativeType(CellProliferativeType cellType); 00402 00406 double GetMinimumGapDuration(); 00407 00413 void SetMinimumGapDuration(double minimumGapDuration); 00414 00421 void OutputCellCycleModelInfo(out_stream& rParamsFile); 00422 00431 virtual void OutputCellCycleModelParameters(out_stream& rParamsFile)=0; 00432 }; 00433 00434 CLASS_IS_ABSTRACT(AbstractCellCycleModel) 00435 00436 #endif /*ABSTRACTCELLCYCLEMODEL_HPP_*/