Chaste  Release::2017.1
CellCycleTimesGenerator Class Reference

#include <CellCycleTimesGenerator.hpp>

+ Inheritance diagram for CellCycleTimesGenerator:
+ Collaboration diagram for CellCycleTimesGenerator:

Public Member Functions

void SetRandomSeed (unsigned randomSeed)
 
unsigned GetRandomSeed ()
 
void SetRate (double rate)
 
double GetRate ()
 
void GenerateCellCycleTimeSequence ()
 
double GetNextCellCycleTime ()
 
- Public Member Functions inherited from SerializableSingleton< CellCycleTimesGenerator >
SerializableSingleton< CellCycleTimesGenerator > * GetSerializationWrapper () const
 

Static Public Member Functions

static CellCycleTimesGeneratorInstance ()
 
static void Destroy ()
 

Protected Member Functions

 CellCycleTimesGenerator ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

unsigned mRandomSeed
 
std::vector< doublemCellCycleTimes
 
unsigned mCurrentIndex
 
double mRate
 
bool mVectorCreated
 

Static Private Attributes

static CellCycleTimesGeneratormpInstance = NULL
 

Friends

class boost::serialization::access
 

Detailed Description

This is a helper class for FixedSequenceCellCycleModel. It comprises a singleton class for producing a fixed stream of exponentially distributed G1 durations.

Definition at line 49 of file CellCycleTimesGenerator.hpp.

Constructor & Destructor Documentation

CellCycleTimesGenerator::CellCycleTimesGenerator ( )
protected

Protected constructor. Use Instance() to access the random number generator.

Definition at line 41 of file CellCycleTimesGenerator.cpp.

References mpInstance.

Referenced by Instance(), and serialize().

Member Function Documentation

void CellCycleTimesGenerator::Destroy ( )
static

Destroy the current instance of the cell cycle times generator. The next call to Instance will create a new instance. This method *must* be called before program exit, to avoid a memory leak.

Definition at line 59 of file CellCycleTimesGenerator.cpp.

References mpInstance.

Referenced by serialize().

void CellCycleTimesGenerator::GenerateCellCycleTimeSequence ( )
double CellCycleTimesGenerator::GetNextCellCycleTime ( )

Get the next cell cycle time

Returns
next_cell_cycle_time the next cell cycle time in the sequence

Definition at line 119 of file CellCycleTimesGenerator.cpp.

References EXCEPTION, mCellCycleTimes, mCurrentIndex, and mVectorCreated.

Referenced by serialize(), and FixedSequenceCellCycleModel::SetG1Duration().

unsigned CellCycleTimesGenerator::GetRandomSeed ( )

Get the random seed for generating the sequence.

Returns
seed The random seed

Definition at line 73 of file CellCycleTimesGenerator.cpp.

References mRandomSeed.

Referenced by serialize().

double CellCycleTimesGenerator::GetRate ( )

Get the rate of the exponential distribution.

Returns
rate The rate of the distribution.

Definition at line 114 of file CellCycleTimesGenerator.cpp.

References mRate.

Referenced by FixedSequenceCellCycleModel::GetRate(), FixedSequenceCellCycleModel::OutputCellCycleModelParameters(), and serialize().

template<class Archive >
void CellCycleTimesGenerator::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Serialization of a CellCycleTimesGenerator object must be done with care. Do not serialize this singleton directly. Instead, serialize the object returned by GetSerializationWrapper.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 98 of file CellCycleTimesGenerator.hpp.

References CellCycleTimesGenerator(), Destroy(), GenerateCellCycleTimeSequence(), GetNextCellCycleTime(), GetRandomSeed(), GetRate(), Instance(), mCellCycleTimes, mCurrentIndex, mRandomSeed, mRate, mVectorCreated, SetRandomSeed(), and SetRate().

void CellCycleTimesGenerator::SetRandomSeed ( unsigned  randomSeed)

Set the random seed for generating the sequence of G1 Durations.

Parameters
randomSeedthe new seed

Definition at line 68 of file CellCycleTimesGenerator.cpp.

References mRandomSeed.

Referenced by serialize().

void CellCycleTimesGenerator::SetRate ( double  rate)

Set the rate of the exponential distribution.

Parameters
rate

Definition at line 102 of file CellCycleTimesGenerator.cpp.

References EXCEPTION, mRate, and mVectorCreated.

Referenced by serialize(), and FixedSequenceCellCycleModel::SetRate().

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 87 of file CellCycleTimesGenerator.hpp.

Member Data Documentation

std::vector<double> CellCycleTimesGenerator::mCellCycleTimes
private

The actual sequence of cell cycle times

Definition at line 64 of file CellCycleTimesGenerator.hpp.

Referenced by GenerateCellCycleTimeSequence(), GetNextCellCycleTime(), and serialize().

unsigned CellCycleTimesGenerator::mCurrentIndex
private

This index is used to keep track of where in the sequence mCellCycleTimes the simulation currently is. Whenever a cell divides, a new cell cycle time gets drawn from mCellCycleTimes and this counter is incremented by one.

Definition at line 72 of file CellCycleTimesGenerator.hpp.

Referenced by GenerateCellCycleTimeSequence(), GetNextCellCycleTime(), and serialize().

CellCycleTimesGenerator * CellCycleTimesGenerator::mpInstance = NULL
staticprivate

The singleton definition

Definition at line 54 of file CellCycleTimesGenerator.hpp.

Referenced by CellCycleTimesGenerator(), Destroy(), and Instance().

unsigned CellCycleTimesGenerator::mRandomSeed
private

The random seed used to generate the series of cell cycle times.

Definition at line 59 of file CellCycleTimesGenerator.hpp.

Referenced by GenerateCellCycleTimeSequence(), GetRandomSeed(), serialize(), and SetRandomSeed().

double CellCycleTimesGenerator::mRate
private

The rate constant of the exponential distribution used to generate mCellCycleTimes.

Definition at line 78 of file CellCycleTimesGenerator.hpp.

Referenced by GenerateCellCycleTimeSequence(), GetRate(), serialize(), and SetRate().

bool CellCycleTimesGenerator::mVectorCreated
private

A flag that changes from False to True when mCellCycleTimes has been generated.

Definition at line 84 of file CellCycleTimesGenerator.hpp.

Referenced by GenerateCellCycleTimeSequence(), GetNextCellCycleTime(), serialize(), and SetRate().


The documentation for this class was generated from the following files: