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 #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(UNSIGNED_UNSET),
00036 mMinimumGapDuration(0.01),
00037
00038 mStemCellG1Duration(14.0),
00039 mTransitCellG1Duration(2.0),
00040 mSDuration(5.0),
00041 mG2Duration(4.0),
00042 mMDuration(1.0)
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
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
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 }
00231
00232 void AbstractCellCycleModel::OutputCellCycleModelInfo(out_stream& rParamsFile)
00233 {
00234 std::string cell_cycle_model_type = GetIdentifier();
00235
00236 *rParamsFile << "\t\t<" << cell_cycle_model_type << ">\n";
00237 OutputCellCycleModelParameters(rParamsFile);
00238 *rParamsFile << "\t\t</" << cell_cycle_model_type << ">\n";
00239 }
00240
00241 void AbstractCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile)
00242 {
00243 *rParamsFile << "\t\t\t<StemCellG1Duration>" << mStemCellG1Duration << "</StemCellG1Duration>\n";
00244 *rParamsFile << "\t\t\t<TransitCellG1Duration>" << mTransitCellG1Duration << "</TransitCellG1Duration>\n";
00245 *rParamsFile << "\t\t\t<SDuration>" << mSDuration << "</SDuration>\n";
00246 *rParamsFile << "\t\t\t<G2Duration>" << mG2Duration << "</G2Duration>\n";
00247 *rParamsFile << "\t\t\t<MDuration>" << mMDuration << "</MDuration>\n";
00248 }
00249