00001 /* 00002 00003 Copyright (c) 2005-2015, University of Oxford. 00004 All rights reserved. 00005 00006 University of Oxford means the Chancellor, Masters and Scholars of the 00007 University of Oxford, having an administrative office at Wellington 00008 Square, Oxford OX1 2JD, UK. 00009 00010 This file is part of Chaste. 00011 00012 Redistribution and use in source and binary forms, with or without 00013 modification, are permitted provided that the following conditions are met: 00014 * Redistributions of source code must retain the above copyright notice, 00015 this list of conditions and the following disclaimer. 00016 * Redistributions in binary form must reproduce the above copyright notice, 00017 this list of conditions and the following disclaimer in the documentation 00018 and/or other materials provided with the distribution. 00019 * Neither the name of the University of Oxford nor the names of its 00020 contributors may be used to endorse or promote products derived from this 00021 software without specific prior written permission. 00022 00023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00024 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00025 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00026 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00027 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00028 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00029 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00030 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00032 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 00034 */ 00035 00036 #ifndef ABSTRACTCELLCYCLEMODEL_HPP_ 00037 #define ABSTRACTCELLCYCLEMODEL_HPP_ 00038 00039 #include "ChasteSerialization.hpp" 00040 #include "ClassIsAbstract.hpp" 00041 #include "Identifiable.hpp" 00042 00043 #include <boost/serialization/base_object.hpp> 00044 00045 #include <vector> 00046 00047 #include "OutputFileHandler.hpp" 00048 #include "CellCyclePhases.hpp" 00049 #include "SimulationTime.hpp" 00050 #include "Cell.hpp" 00051 00052 class Cell; // Circular definition (cells need to know about cycle models and vice-versa) 00053 typedef boost::shared_ptr<Cell> CellPtr; 00054 00061 class AbstractCellCycleModel : public Identifiable, boost::noncopyable 00062 { 00063 private: 00064 00066 friend class boost::serialization::access; 00073 template<class Archive> 00074 void serialize(Archive & archive, const unsigned int version) 00075 { 00076 // Make sure the SimulationTime singleton gets saved too 00077 SerializableSingleton<SimulationTime>* p_time_wrapper = SimulationTime::Instance()->GetSerializationWrapper(); 00078 archive & p_time_wrapper; 00079 00080 // DO NOT archive & mpCell; -- The CellCycleModel is only ever archived from the Cell 00081 // which knows this and it is handled in the load_construct of Cell. 00082 archive & mBirthTime; 00083 archive & mCurrentCellCyclePhase; 00084 archive & mG1Duration; 00085 archive & mReadyToDivide; 00086 archive & mDimension; 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 00132 double mMinimumGapDuration; 00133 00139 double mStemCellG1Duration; 00140 00145 double mTransitCellG1Duration; 00146 00150 double mSDuration; 00151 00155 double mG2Duration; 00156 00160 double mMDuration; 00161 00162 public: 00163 00168 AbstractCellCycleModel(); 00169 00175 virtual ~AbstractCellCycleModel(); 00176 00186 void SetCell(CellPtr pCell); 00187 00199 virtual void Initialise(); 00200 00213 virtual void InitialiseDaughterCell(); 00214 00218 CellPtr GetCell(); 00219 00228 virtual void SetBirthTime(double birthTime); 00229 00235 void SetDimension(unsigned dimension); 00236 00240 unsigned GetDimension(); 00241 00245 double GetBirthTime() const; 00246 00250 double GetAge(); 00251 00260 virtual bool ReadyToDivide(); 00261 00268 virtual void UpdateCellCyclePhase()=0; 00269 00278 virtual void ResetForDivision(); 00279 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 virtual void SetStemCellG1Duration(double stemCellG1Duration); 00343 00349 virtual 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 double GetMinimumGapDuration(); 00393 00399 void SetMinimumGapDuration(double minimumGapDuration); 00400 00407 void OutputCellCycleModelInfo(out_stream& rParamsFile); 00408 00417 virtual void OutputCellCycleModelParameters(out_stream& rParamsFile)=0; 00418 }; 00419 00420 CLASS_IS_ABSTRACT(AbstractCellCycleModel) 00421 00422 #endif /*ABSTRACTCELLCYCLEMODEL_HPP_*/