AbstractCellCycleModel.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "AbstractCellCycleModel.hpp"
00037
00038 AbstractCellCycleModel::AbstractCellCycleModel()
00039 : mBirthTime(SimulationTime::Instance()->GetTime()),
00040 mCurrentCellCyclePhase(M_PHASE),
00041 mG1Duration(DOUBLE_UNSET),
00042 mReadyToDivide(false),
00043 mDimension(UNSIGNED_UNSET),
00044 mMinimumGapDuration(0.01),
00045
00046 mStemCellG1Duration(14.0),
00047 mTransitCellG1Duration(2.0),
00048 mSDuration(5.0),
00049 mG2Duration(4.0),
00050 mMDuration(1.0)
00051 {
00052 }
00053
00054 AbstractCellCycleModel::~AbstractCellCycleModel()
00055 {
00056 }
00057
00058 void AbstractCellCycleModel::Initialise()
00059 {
00060 }
00061
00062 void AbstractCellCycleModel::InitialiseDaughterCell()
00063 {
00064 }
00065
00066 void AbstractCellCycleModel::SetCell(CellPtr pCell)
00067 {
00068 mpCell = pCell;
00069 }
00070
00071 CellPtr AbstractCellCycleModel::GetCell()
00072 {
00073 assert(mpCell != NULL);
00074 return mpCell;
00075 }
00076
00077 void AbstractCellCycleModel::SetBirthTime(double birthTime)
00078 {
00079 mBirthTime = birthTime;
00080 }
00081
00082 double AbstractCellCycleModel::GetBirthTime() const
00083 {
00084 return mBirthTime;
00085 }
00086
00087 double AbstractCellCycleModel::GetAge()
00088 {
00089 return SimulationTime::Instance()->GetTime() - mBirthTime;
00090 }
00091
00092 CellCyclePhase AbstractCellCycleModel::GetCurrentCellCyclePhase()
00093 {
00094 return mCurrentCellCyclePhase;
00095 }
00096
00097 void AbstractCellCycleModel::ResetForDivision()
00098 {
00099 assert(mReadyToDivide);
00100 mCurrentCellCyclePhase = M_PHASE;
00101 mReadyToDivide = false;
00102 }
00103
00104 double AbstractCellCycleModel::GetG1Duration()
00105 {
00106 return mG1Duration;
00107 }
00108
00110
00112
00113 double AbstractCellCycleModel::GetStemCellG1Duration()
00114 {
00115 return mStemCellG1Duration;
00116 }
00117
00118 double AbstractCellCycleModel::GetTransitCellG1Duration()
00119 {
00120 return mTransitCellG1Duration;
00121 }
00122
00123 double AbstractCellCycleModel::GetSG2MDuration()
00124 {
00125 return mSDuration + mG2Duration + mMDuration;
00126 }
00127
00128 double AbstractCellCycleModel::GetSDuration()
00129 {
00130 return mSDuration;
00131 }
00132
00133 double AbstractCellCycleModel::GetG2Duration()
00134 {
00135 return mG2Duration;
00136 }
00137
00138 double AbstractCellCycleModel::GetMDuration()
00139 {
00140 return mMDuration;
00141 }
00142
00144
00146
00147 void AbstractCellCycleModel::SetStemCellG1Duration(double stemCellG1Duration)
00148 {
00149 assert(stemCellG1Duration > 0.0);
00150 mStemCellG1Duration = stemCellG1Duration;
00151 }
00152 void AbstractCellCycleModel::SetTransitCellG1Duration(double transitCellG1Duration)
00153 {
00154 assert(transitCellG1Duration > 0.0);
00155 mTransitCellG1Duration = transitCellG1Duration;
00156 }
00157 void AbstractCellCycleModel::SetSDuration(double SDuration)
00158 {
00159 assert(SDuration > 0.0);
00160 mSDuration = SDuration;
00161 }
00162 void AbstractCellCycleModel::SetG2Duration(double G2Duration)
00163 {
00164 assert(G2Duration > 0.0);
00165 mG2Duration = G2Duration;
00166 }
00167 void AbstractCellCycleModel::SetMDuration(double MDuration)
00168 {
00169 assert(MDuration > 0.0);
00170 mMDuration = MDuration;
00171 }
00172
00173 bool AbstractCellCycleModel::ReadyToDivide()
00174 {
00175 assert(mpCell != NULL);
00176
00177 if (!mReadyToDivide)
00178 {
00179 UpdateCellCyclePhase();
00180 if ( (mCurrentCellCyclePhase != G_ZERO_PHASE) &&
00181 (GetAge() >= GetMDuration() + GetG1Duration() + GetSDuration() + GetG2Duration()) )
00182 {
00183 mReadyToDivide = true;
00184 }
00185 }
00186 return mReadyToDivide;
00187 }
00188
00189 void AbstractCellCycleModel::SetDimension(unsigned dimension)
00190 {
00191 if (dimension != 1 && dimension !=2 && dimension != 3)
00192 {
00193 EXCEPTION("Dimension must be 1, 2 or 3");
00194 }
00195 mDimension = dimension;
00196 }
00197
00198 unsigned AbstractCellCycleModel::GetDimension()
00199 {
00200 return mDimension;
00201 }
00202
00203 double AbstractCellCycleModel::GetAverageTransitCellCycleTime()
00204 {
00205 return mTransitCellG1Duration + GetSG2MDuration();
00206 }
00207
00208 double AbstractCellCycleModel::GetAverageStemCellCycleTime()
00209 {
00210 return mStemCellG1Duration + GetSG2MDuration();
00211 }
00212
00213 bool AbstractCellCycleModel::CanCellTerminallyDifferentiate()
00214 {
00215 return true;
00216 }
00217
00218 void AbstractCellCycleModel::SetMinimumGapDuration(double minimumGapDuration)
00219 {
00220 assert(minimumGapDuration > 0.0);
00221 mMinimumGapDuration = minimumGapDuration;
00222 }
00223
00224 double AbstractCellCycleModel::GetMinimumGapDuration()
00225 {
00226 return mMinimumGapDuration;
00227 }
00228
00229 void AbstractCellCycleModel::OutputCellCycleModelInfo(out_stream& rParamsFile)
00230 {
00231 std::string cell_cycle_model_type = GetIdentifier();
00232
00233 *rParamsFile << "\t\t<" << cell_cycle_model_type << ">\n";
00234 OutputCellCycleModelParameters(rParamsFile);
00235 *rParamsFile << "\t\t</" << cell_cycle_model_type << ">\n";
00236 }
00237
00238 void AbstractCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile)
00239 {
00240 *rParamsFile << "\t\t\t<StemCellG1Duration>" << mStemCellG1Duration << "</StemCellG1Duration>\n";
00241 *rParamsFile << "\t\t\t<TransitCellG1Duration>" << mTransitCellG1Duration << "</TransitCellG1Duration>\n";
00242 *rParamsFile << "\t\t\t<SDuration>" << mSDuration << "</SDuration>\n";
00243 *rParamsFile << "\t\t\t<G2Duration>" << mG2Duration << "</G2Duration>\n";
00244 *rParamsFile << "\t\t\t<MDuration>" << mMDuration << "</MDuration>\n";
00245 }