00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2009 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 <boost/serialization/access.hpp> 00032 #include <boost/serialization/is_abstract.hpp> 00033 #include <boost/serialization/base_object.hpp> 00034 00035 #include <vector> 00036 00037 #include "CellTypes.hpp" 00038 #include "CellCyclePhases.hpp" 00039 #include "SimulationTime.hpp" 00040 #include "CancerParameters.hpp" 00041 #include "TissueCell.hpp" 00042 00043 // Needs to be included last 00044 #include <boost/serialization/export.hpp> 00045 00046 class TissueCell; // Circular definition (cells need to know about cycle models and vice-versa) 00047 00048 00053 class AbstractCellCycleModel 00054 { 00055 private: 00056 00058 friend class boost::serialization::access; 00070 template<class Archive> 00071 void serialize(Archive & archive, const unsigned int version) 00072 { 00073 // Make sure the simulation and cancer parameters get saved too 00074 SimulationTime* p_time = SimulationTime::Instance(); 00075 archive & *p_time; 00076 archive & p_time; 00077 CancerParameters* p_params = CancerParameters::Instance(); 00078 archive & *p_params; 00079 archive & p_params; 00080 00081 // DO NOT archive & mpCell; -- The CellCycleModel is only ever archived from the Cell 00082 // which knows this and it is handled in the load_construct of TissueCell. 00083 archive & mBirthTime; 00084 archive & mCurrentCellCyclePhase; 00085 archive & mG1Duration; 00086 archive & mReadyToDivide; 00087 } 00088 00089 protected: 00090 00092 TissueCell* mpCell; 00093 00098 double mBirthTime; 00099 00101 CellCyclePhase mCurrentCellCyclePhase; 00102 00107 double mG1Duration; 00108 00112 bool mReadyToDivide; 00113 00114 public: 00115 00120 AbstractCellCycleModel(); 00121 00125 virtual ~AbstractCellCycleModel(); 00126 00136 void SetCell(TissueCell* pCell); 00137 00149 virtual void Initialise() 00150 {} 00151 00164 virtual void InitialiseDaughterCell() 00165 {} 00166 00170 TissueCell* GetCell(); 00171 00180 virtual void SetBirthTime(double birthTime); 00181 00185 double GetBirthTime() const; 00186 00190 double GetAge(); 00191 00200 bool ReadyToDivide(); 00201 00208 virtual void UpdateCellCyclePhase()=0; 00209 00218 virtual void ResetForDivision(); 00219 00235 virtual AbstractCellCycleModel* CreateCellCycleModel(); 00236 00249 virtual AbstractCellCycleModel* CreateDaughterCellCycleModel()=0; 00250 00254 CellCyclePhase GetCurrentCellCyclePhase(); 00255 00259 virtual double GetG1Duration(); 00260 00264 virtual double GetSDuration(); 00265 00269 virtual double GetG2Duration(); 00270 00274 virtual double GetMDuration(); 00275 00276 }; 00277 00278 00279 BOOST_IS_ABSTRACT(AbstractCellCycleModel) 00280 00281 00282 #endif /*ABSTRACTCELLCYCLEMODEL_HPP_*/