Chaste  Release::3.4
AbstractCellCycleModel.cpp
1 /*
2 
3 Copyright (c) 2005-2016, University of Oxford.
4 All rights reserved.
5 
6 University of Oxford means the Chancellor, Masters and Scholars of the
7 University of Oxford, having an administrative office at Wellington
8 Square, Oxford OX1 2JD, UK.
9 
10 This file is part of Chaste.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #include "AbstractCellCycleModel.hpp"
37 
39  : mBirthTime(SimulationTime::Instance()->GetTime()),
40  mCurrentCellCyclePhase(M_PHASE),
41  mG1Duration(DOUBLE_UNSET),
42  mReadyToDivide(false),
43  mDimension(UNSIGNED_UNSET),
44  mMinimumGapDuration(0.01), // an educated guess
45  // Default parameter values all have units of hours.
46  mStemCellG1Duration(14.0),
47  mTransitCellG1Duration(2.0),
48  mSDuration(5.0), // apparently between 5-6 hours normally
49  mG2Duration(4.0), // apparently 3-4 hours normally
50  mMDuration(1.0) // taken from Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
51 {
52 }
53 
55 {
56 }
57 
59 {
60 }
61 
63 {
64 }
65 
67 {
68  mpCell = pCell;
69 }
70 
72 {
73  assert(mpCell != NULL);
74  return mpCell;
75 }
76 
78 {
79  mBirthTime = birthTime;
80 }
81 
83 {
84  return mBirthTime;
85 }
86 
88 {
90 }
91 
93 {
95 }
96 
98 {
99  assert(mReadyToDivide);
100  mCurrentCellCyclePhase = M_PHASE;
101  mReadyToDivide = false;
102 }
103 
105 {
106  return mG1Duration;
107 }
108 
110 // Getter methods
112 
114 {
115  return mStemCellG1Duration;
116 }
117 
119 {
120  return mTransitCellG1Duration;
121 }
122 
124 {
125  return mSDuration + mG2Duration + mMDuration;
126 }
127 
129 {
130  return mSDuration;
131 }
132 
134 {
135  return mG2Duration;
136 }
137 
139 {
140  return mMDuration;
141 }
142 
144 // Setter methods
146 
147 void AbstractCellCycleModel::SetStemCellG1Duration(double stemCellG1Duration)
148 {
149  assert(stemCellG1Duration > 0.0);
150  mStemCellG1Duration = stemCellG1Duration;
151 }
152 void AbstractCellCycleModel::SetTransitCellG1Duration(double transitCellG1Duration)
153 {
154  assert(transitCellG1Duration > 0.0);
155  mTransitCellG1Duration = transitCellG1Duration;
156 }
158 {
159  assert(SDuration > 0.0);
160  mSDuration = SDuration;
161 }
163 {
164  assert(G2Duration > 0.0);
165  mG2Duration = G2Duration;
166 }
168 {
169  assert(MDuration > 0.0);
170  mMDuration = MDuration;
171 }
172 
174 {
175  assert(mpCell != NULL);
176 
177  if (!mReadyToDivide)
178  {
180  if ( (mCurrentCellCyclePhase != G_ZERO_PHASE) &&
182  {
183  mReadyToDivide = true;
184  }
185  }
186  return mReadyToDivide;
187 }
188 
189 void AbstractCellCycleModel::SetDimension(unsigned dimension)
190 {
191  if (dimension != 1 && dimension !=2 && dimension != 3)
192  {
193  EXCEPTION("Dimension must be 1, 2 or 3");
194  }
195  mDimension = dimension;
196 }
197 
199 {
200  return mDimension;
201 }
202 
204 {
206 }
207 
209 {
211 }
212 
214 {
215  return true;
216 }
217 
218 void AbstractCellCycleModel::SetMinimumGapDuration(double minimumGapDuration)
219 {
220  assert(minimumGapDuration > 0.0);
221  mMinimumGapDuration = minimumGapDuration;
222 }
223 
225 {
226  return mMinimumGapDuration;
227 }
228 
230 {
231  std::string cell_cycle_model_type = GetIdentifier();
232 
233  *rParamsFile << "\t\t<" << cell_cycle_model_type << ">\n";
234  OutputCellCycleModelParameters(rParamsFile);
235  *rParamsFile << "\t\t</" << cell_cycle_model_type << ">\n";
236 }
237 
239 {
240  *rParamsFile << "\t\t\t<StemCellG1Duration>" << mStemCellG1Duration << "</StemCellG1Duration>\n";
241  *rParamsFile << "\t\t\t<TransitCellG1Duration>" << mTransitCellG1Duration << "</TransitCellG1Duration>\n";
242  *rParamsFile << "\t\t\t<SDuration>" << mSDuration << "</SDuration>\n";
243  *rParamsFile << "\t\t\t<G2Duration>" << mG2Duration << "</G2Duration>\n";
244  *rParamsFile << "\t\t\t<MDuration>" << mMDuration << "</MDuration>\n";
245 }
virtual void SetBirthTime(double birthTime)
void OutputCellCycleModelInfo(out_stream &rParamsFile)
virtual void SetStemCellG1Duration(double stemCellG1Duration)
virtual void UpdateCellCyclePhase()=0
void SetMinimumGapDuration(double minimumGapDuration)
void SetMDuration(double mDuration)
#define EXCEPTION(message)
Definition: Exception.hpp:143
static SimulationTime * Instance()
void SetG2Duration(double g2Duration)
virtual bool CanCellTerminallyDifferentiate()
const double DOUBLE_UNSET
Definition: Exception.hpp:56
void SetDimension(unsigned dimension)
CellCyclePhase GetCurrentCellCyclePhase()
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)=0
const unsigned UNSIGNED_UNSET
Definition: Exception.hpp:52
virtual void SetTransitCellG1Duration(double transitCellG1Duration)
double GetTime() const
virtual double GetAverageStemCellCycleTime()
std::string GetIdentifier() const
void SetSDuration(double sDuration)
virtual double GetAverageTransitCellCycleTime()