Chaste Release::3.1
AbstractCellCycleModel.hpp
00001 /*
00002 
00003 Copyright (c) 2005-2012, 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 "CellProliferativeTypes.hpp"
00049 #include "CellCyclePhases.hpp"
00050 #include "SimulationTime.hpp"
00051 #include "Cell.hpp"
00052 
00053 class Cell; // Circular definition (cells need to know about cycle models and vice-versa)
00054 typedef boost::shared_ptr<Cell> CellPtr;
00055 
00062 class AbstractCellCycleModel : public Identifiable, boost::noncopyable
00063 {
00064 private:
00065 
00067     friend class boost::serialization::access;
00074     template<class Archive>
00075     void serialize(Archive & archive, const unsigned int version)
00076     {
00077         // Make sure the SimulationTime singleton gets saved too
00078         SerializableSingleton<SimulationTime>* p_time_wrapper = SimulationTime::Instance()->GetSerializationWrapper();
00079         archive & p_time_wrapper;
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 Cell.
00083         archive & mBirthTime;
00084         archive & mCurrentCellCyclePhase;
00085         archive & mG1Duration;
00086         archive & mReadyToDivide;
00087         archive & mDimension;
00088         archive & mMinimumGapDuration;
00089         archive & mStemCellG1Duration;
00090         archive & mTransitCellG1Duration;
00091         archive & mSDuration;
00092         archive & mG2Duration;
00093         archive & mMDuration;
00094     }
00095 
00096 protected:
00097 
00099     CellPtr mpCell;
00100 
00105     double mBirthTime;
00106 
00108     CellCyclePhase mCurrentCellCyclePhase;
00109 
00114     double mG1Duration;
00115 
00119     bool mReadyToDivide;
00120 
00124     unsigned mDimension;
00125 
00133     double mMinimumGapDuration;
00134 
00140     double mStemCellG1Duration;
00141 
00146     double mTransitCellG1Duration;
00147 
00151     double mSDuration;
00152 
00156     double mG2Duration;
00157 
00161     double mMDuration;
00162 
00163 public:
00164 
00169     AbstractCellCycleModel();
00170 
00176     virtual ~AbstractCellCycleModel();
00177 
00187     void SetCell(CellPtr pCell);
00188 
00200     virtual void Initialise();
00201 
00214     virtual void InitialiseDaughterCell();
00215 
00219     CellPtr GetCell();
00220 
00229     virtual void SetBirthTime(double birthTime);
00230 
00236     void SetDimension(unsigned dimension);
00237 
00241     unsigned GetDimension();
00242 
00246     double GetBirthTime() const;
00247 
00251     double GetAge();
00252 
00261     virtual bool ReadyToDivide();
00262 
00269     virtual void UpdateCellCyclePhase()=0;
00270 
00279     virtual void ResetForDivision();
00280 
00293     virtual AbstractCellCycleModel* CreateCellCycleModel()=0;
00294 
00298     CellCyclePhase GetCurrentCellCyclePhase();
00299 
00303     virtual double GetG1Duration();
00304 
00308     double GetStemCellG1Duration();
00309 
00313     double GetTransitCellG1Duration();
00314 
00318     double GetSG2MDuration();
00319 
00323     virtual double GetSDuration();
00324 
00328     virtual double GetG2Duration();
00329 
00333     virtual double GetMDuration();
00334 
00340     void SetStemCellG1Duration(double stemCellG1Duration);
00341 
00347     void SetTransitCellG1Duration(double transitCellG1Duration);
00348 
00354     void SetSDuration(double sDuration);
00355 
00361     void SetG2Duration(double g2Duration);
00362 
00368     void SetMDuration(double mDuration);
00369 
00374     virtual double GetAverageTransitCellCycleTime();
00375 
00380     virtual double GetAverageStemCellCycleTime();
00381 
00385     virtual bool CanCellTerminallyDifferentiate();
00386 
00390     double GetMinimumGapDuration();
00391 
00397     void SetMinimumGapDuration(double minimumGapDuration);
00398 
00405     void OutputCellCycleModelInfo(out_stream& rParamsFile);
00406 
00415     virtual void OutputCellCycleModelParameters(out_stream& rParamsFile)=0;
00416 };
00417 
00418 CLASS_IS_ABSTRACT(AbstractCellCycleModel)
00419 
00420 #endif /*ABSTRACTCELLCYCLEMODEL_HPP_*/