AbstractCellCycleModel.cpp

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 #include "AbstractCellCycleModel.hpp"
00029 
00030 AbstractCellCycleModel::AbstractCellCycleModel()
00031     : mBirthTime(SimulationTime::Instance()->GetTime()),
00032       mCurrentCellCyclePhase(M_PHASE),
00033       mG1Duration(DOUBLE_UNSET),
00034       mReadyToDivide(false),
00035       mDimension(0),
00036       mMinimumGapDuration(0.01), // an educated guess
00037       // Default parameter values all have units of hours.
00038       mStemCellG1Duration(14.0),
00039       mTransitCellG1Duration(2.0),
00040       mSDuration(5.0),               // apparently between 5-6 hours normally
00041       mG2Duration(4.0),              // apparently 3-4 hours normally
00042       mMDuration(1.0)               // taken from Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
00043 {
00044 }
00045 
00046 AbstractCellCycleModel::~AbstractCellCycleModel()
00047 {
00048 }
00049 
00050 void AbstractCellCycleModel::Initialise()
00051 {
00052 }
00053 
00054 void AbstractCellCycleModel::InitialiseDaughterCell()
00055 {
00056 }
00057 
00058 void AbstractCellCycleModel::SetCell(CellPtr pCell)
00059 {
00060     mpCell = pCell;
00061 }
00062 
00063 CellPtr AbstractCellCycleModel::GetCell()
00064 {
00065     assert(mpCell != NULL);
00066     return mpCell;
00067 }
00068 
00069 void AbstractCellCycleModel::SetBirthTime(double birthTime)
00070 {
00071     mBirthTime = birthTime;
00072 }
00073 
00074 double AbstractCellCycleModel::GetBirthTime() const
00075 {
00076     return mBirthTime;
00077 }
00078 
00079 double AbstractCellCycleModel::GetAge()
00080 {
00081     return SimulationTime::Instance()->GetTime() - mBirthTime;
00082 }
00083 
00084 CellCyclePhase AbstractCellCycleModel::GetCurrentCellCyclePhase()
00085 {
00086     return mCurrentCellCyclePhase;
00087 }
00088 
00089 void AbstractCellCycleModel::ResetForDivision()
00090 {
00091     assert(mReadyToDivide);
00092     mCurrentCellCyclePhase = M_PHASE;
00093     mReadyToDivide = false;
00094 }
00095 
00096 double AbstractCellCycleModel::GetG1Duration()
00097 {
00098     return mG1Duration;
00099 }
00100 
00102 // Getter methods
00104 
00105 double AbstractCellCycleModel::GetStemCellG1Duration()
00106 {
00107     return mStemCellG1Duration;
00108 }
00109 
00110 double AbstractCellCycleModel::GetTransitCellG1Duration()
00111 {
00112     return mTransitCellG1Duration;
00113 }
00114 
00115 double AbstractCellCycleModel::GetSG2MDuration()
00116 {
00117     return mSDuration + mG2Duration + mMDuration;
00118 }
00119 
00120 double AbstractCellCycleModel::GetSDuration()
00121 {
00122     return mSDuration;
00123 }
00124 
00125 double AbstractCellCycleModel::GetG2Duration()
00126 {
00127     return mG2Duration;
00128 }
00129 
00130 double AbstractCellCycleModel::GetMDuration()
00131 {
00132     return mMDuration;
00133 }
00134 
00136 // Setter methods
00138 
00139 void AbstractCellCycleModel::SetStemCellG1Duration(double stemCellG1Duration)
00140 {
00141     assert(stemCellG1Duration > 0.0);
00142     mStemCellG1Duration = stemCellG1Duration;
00143 }
00144 void AbstractCellCycleModel::SetTransitCellG1Duration(double transitCellG1Duration)
00145 {
00146     assert(transitCellG1Duration > 0.0);
00147     mTransitCellG1Duration = transitCellG1Duration;
00148 }
00149 void AbstractCellCycleModel::SetSDuration(double SDuration)
00150 {
00151     assert(SDuration > 0.0);
00152     mSDuration = SDuration;
00153 }
00154 void AbstractCellCycleModel::SetG2Duration(double G2Duration)
00155 {
00156     assert(G2Duration > 0.0);
00157     mG2Duration = G2Duration;
00158 }
00159 void AbstractCellCycleModel::SetMDuration(double MDuration)
00160 {
00161     assert(MDuration > 0.0);
00162     mMDuration = MDuration;
00163 }
00164 
00165 bool AbstractCellCycleModel::ReadyToDivide()
00166 {
00167     assert(mpCell != NULL);
00168 
00169     if (!mReadyToDivide)
00170     {
00171         UpdateCellCyclePhase();
00172         if ( (mCurrentCellCyclePhase != G_ZERO_PHASE) &&
00173              (GetAge() >= GetMDuration() + GetG1Duration() + GetSDuration() + GetG2Duration()) )
00174         {
00175             mReadyToDivide = true;
00176         }
00177     }
00178     return mReadyToDivide;
00179 }
00180 
00181 void AbstractCellCycleModel::SetDimension(unsigned dimension)
00182 {
00183     if (dimension != 1 && dimension !=2 && dimension != 3)
00184     {
00185         EXCEPTION("Dimension must be 1, 2 or 3");
00186     }
00187     mDimension = dimension;
00188 }
00189 
00190 unsigned AbstractCellCycleModel::GetDimension()
00191 {
00192     return mDimension;
00193 }
00194 
00195 double AbstractCellCycleModel::GetAverageTransitCellCycleTime()
00196 {
00197     return mTransitCellG1Duration + GetSG2MDuration();
00198 }
00199 
00200 double AbstractCellCycleModel::GetAverageStemCellCycleTime()
00201 {
00202     return mStemCellG1Duration + GetSG2MDuration();
00203 }
00204 
00205 bool AbstractCellCycleModel::CanCellTerminallyDifferentiate()
00206 {
00207     return true;
00208 }
00209 
00210 void AbstractCellCycleModel::SetCellProliferativeType(CellProliferativeType cellType)
00211 {
00212     mCellProliferativeType = cellType;
00213 }
00214 
00215 
00216 CellProliferativeType AbstractCellCycleModel::GetCellProliferativeType() const
00217 {
00218     return mCellProliferativeType;
00219 }
00220 
00221 void AbstractCellCycleModel::SetMinimumGapDuration(double minimumGapDuration)
00222 {
00223     assert(minimumGapDuration > 0.0);
00224     mMinimumGapDuration = minimumGapDuration;
00225 }
00226 
00227 double AbstractCellCycleModel::GetMinimumGapDuration()
00228 {
00229     return mMinimumGapDuration;
00230 }

Generated on Mon Nov 1 12:35:16 2010 for Chaste by  doxygen 1.5.5