Chaste  Release::2017.1
AbstractPhaseBasedCellCycleModel.cpp
1 /*
2 
3 Copyright (c) 2005-2017, 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 "AbstractPhaseBasedCellCycleModel.hpp"
37 
40  mCurrentCellCyclePhase(M_PHASE),
41  mG1Duration(DOUBLE_UNSET),
42  mMinimumGapDuration(0.01), // an educated guess
43  // Default parameter values all have units of hours.
44  mStemCellG1Duration(14.0),
45  mTransitCellG1Duration(2.0),
46  mSDuration(5.0), // apparently between 5-6 hours normally
47  mG2Duration(4.0), // apparently 3-4 hours normally
48  mMDuration(1.0) // taken from Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
49 {
50 }
51 
53 {
54 }
55 
57  : AbstractCellCycleModel(rModel),
59  mG1Duration(rModel.mG1Duration),
63  mSDuration(rModel.mSDuration),
64  mG2Duration(rModel.mG2Duration),
65  mMDuration(rModel.mMDuration)
66 {
67  /*
68  * Initialize only those member variables defined in this class.
69  *
70  * The member variables mBirthTime, mReadyToDivide and mDimension
71  * are initialized in the AbstractCellCycleModel constructor.
72  */
73 }
74 
76 {
78  mCurrentCellCyclePhase = M_PHASE;
79 }
80 
82 {
83  assert(mpCell != nullptr);
84 
85  if (!mReadyToDivide)
86  {
88  if ((mCurrentCellCyclePhase != G_ZERO_PHASE) &&
90  {
91  mReadyToDivide = true;
92  }
93  }
94  return mReadyToDivide;
95 }
96 
98 {
99  return mG1Duration;
100 }
101 
103 {
104  return mStemCellG1Duration;
105 }
106 
108 {
109  return mTransitCellG1Duration;
110 }
111 
113 {
114  return mSDuration + mG2Duration + mMDuration;
115 }
116 
118 {
119  return mSDuration;
120 }
121 
123 {
124  return mG2Duration;
125 }
126 
128 {
129  return mMDuration;
130 }
131 
133 {
134  return mCurrentCellCyclePhase;
135 }
136 
138 {
140 }
141 
143 {
145 }
146 
148 {
149  return mMinimumGapDuration;
150 }
151 
153 {
154  assert(stemCellG1Duration >= 0.0);
155  mStemCellG1Duration = stemCellG1Duration;
156 }
157 
159 {
160  assert(transitCellG1Duration >= 0.0);
161  mTransitCellG1Duration = transitCellG1Duration;
162 }
163 
165 {
166  assert(SDuration >= 0.0);
167  mSDuration = SDuration;
168 }
169 
171 {
172  assert(G2Duration >= 0.0);
173  mG2Duration = G2Duration;
174 }
175 
177 {
178  assert(MDuration >= 0.0);
179  mMDuration = MDuration;
180 }
181 
183 {
184  assert(minimumGapDuration > 0.0);
185  mMinimumGapDuration = minimumGapDuration;
186 }
187 
189 {
190  *rParamsFile << "\t\t\t<StemCellG1Duration>" << mStemCellG1Duration << "</StemCellG1Duration>\n";
191  *rParamsFile << "\t\t\t<TransitCellG1Duration>" << mTransitCellG1Duration << "</TransitCellG1Duration>\n";
192  *rParamsFile << "\t\t\t<SDuration>" << mSDuration << "</SDuration>\n";
193  *rParamsFile << "\t\t\t<G2Duration>" << mG2Duration << "</G2Duration>\n";
194  *rParamsFile << "\t\t\t<MDuration>" << mMDuration << "</MDuration>\n";
195 
196  // Call method on direct parent class
198 }
virtual void SetTransitCellG1Duration(double transitCellG1Duration)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)=0
const double DOUBLE_UNSET
Definition: Exception.hpp:56
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)=0
virtual void UpdateCellCyclePhase()=0
void SetMinimumGapDuration(double minimumGapDuration)
virtual void SetStemCellG1Duration(double stemCellG1Duration)