Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
FixedSequenceCellCycleModel.cpp
1/*
2
3Copyright (c) 2005-2024, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, 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
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34*/
35
36#include "FixedSequenceCellCycleModel.hpp"
37#include "Exception.hpp"
38#include "StemCellProliferativeType.hpp"
39#include "TransitCellProliferativeType.hpp"
40#include "DifferentiatedCellProliferativeType.hpp"
41#include "CellCycleTimesGenerator.hpp"
42
48
51{
52 /*
53 * Set each member variable of the new cell-cycle model that inherits
54 * its value from the parent.
55 *
56 * Note 1: some of the new cell-cycle model's member variables will already
57 * have been correctly initialized in its constructor or parent classes.
58 *
59 * Note 2: one or more of the new cell-cycle model's member variables
60 * may be set/overwritten as soon as InitialiseDaughterCell() is called on
61 * the new cell-cycle model.
62 *
63 * Note 3: Only set the variables defined in this class. Variables defined
64 * in parent classes will be defined there.
65 *
66 */
67}
68
73
75{
76 CellCycleTimesGenerator* p_cell_cycle_times_generator = CellCycleTimesGenerator::Instance();
77
78 if ( mpCell->GetCellProliferativeType()->IsType<StemCellProliferativeType>()
79 || mpCell->GetCellProliferativeType()->IsType<TransitCellProliferativeType>() )
80 {
81 // Generate an exponential random number with mScale
82 mG1Duration = p_cell_cycle_times_generator->GetNextCellCycleTime();
83 }
84 else if (mpCell->GetCellProliferativeType()->IsType<DifferentiatedCellProliferativeType>())
85 {
86 mG1Duration = DBL_MAX;
87 }
88 else
89 {
91 }
92}
93
95{
96 CellCycleTimesGenerator* p_cell_cycle_times_generator = CellCycleTimesGenerator::Instance();
97 p_cell_cycle_times_generator->SetRate(rate);
98 mTransitCellG1Duration = 1.0/rate;
99 mStemCellG1Duration = 1.0/rate;
100}
101
103{
104 CellCycleTimesGenerator* p_cell_cycle_times_generator = CellCycleTimesGenerator::Instance();
105 return p_cell_cycle_times_generator->GetRate();
106}
107
109{
110 EXCEPTION("This cell cycle model does not differentiate stem cells and transit cells, please use SetRate() instead");
111}
112
114{
115 EXCEPTION("This cell cycle model does not differentiate stem cells and transit cells, please use SetRate() instead");
116}
117
119{
120 *rParamsFile << "\t\t\t<Rate>" << CellCycleTimesGenerator::Instance()->GetRate() << "</Rate>\n";
121
122 // Call method on direct parent class
124}
125// Serialization for Boost >= 1.36
#define EXCEPTION(message)
#define NEVER_REACHED
#define CHASTE_CLASS_EXPORT(T)
static CellCycleTimesGenerator * Instance()
void SetStemCellG1Duration(double stemCellG1Duration)
AbstractCellCycleModel * CreateCellCycleModel()
void SetTransitCellG1Duration(double transitCellG1Duration)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)