Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
AbstractSrnModel Class Referenceabstract

#include <AbstractSrnModel.hpp>

+ Inheritance diagram for AbstractSrnModel:
+ Collaboration diagram for AbstractSrnModel:

Public Member Functions

 AbstractSrnModel ()
 
virtual ~AbstractSrnModel ()
 
virtual void SetCell (CellPtr pCell)
 
virtual void Initialise ()
 
virtual void InitialiseDaughterCell ()
 
CellPtr GetCell ()
 
void SetSimulatedToTime (double simulatedToTime)
 
double GetSimulatedToTime () const
 
virtual void SimulateToCurrentTime ()=0
 
virtual void ResetForDivision ()
 
virtual AbstractSrnModelCreateSrnModel ()=0
 
void OutputSrnModelInfo (out_stream &rParamsFile)
 
virtual void OutputSrnModelParameters (out_stream &rParamsFile)
 
void SetEdgeLocalIndex (unsigned index)
 
unsigned GetEdgeLocalIndex ()
 
bool HasEdgeModel () const
 
void SetEdgeModelIndicator (const bool isEdgeModel)
 
virtual void ScaleSrnVariables (const double theta)
 
virtual void AddSrnQuantities (AbstractSrnModel *pOtherSrn, const double scale=1.0)
 
virtual void AddShrunkEdgeSrn (AbstractSrnModel *pShrunkEdgeSrn)
 
virtual void AddMergedEdgeSrn (AbstractSrnModel *pMergedEdgeSrn)
 
virtual void AddShrunkEdgeToInterior (AbstractSrnModel *pShrunkEdgeSrn)
 
virtual void SplitEdgeSrn (const double relativePosition)
 
- Public Member Functions inherited from Identifiable
virtual ~Identifiable ()
 
std::string GetIdentifier () const
 

Protected Member Functions

 AbstractSrnModel (const AbstractSrnModel &rModel)
 

Protected Attributes

CellPtr mpCell
 
double mSimulatedToTime
 
unsigned mEdgeLocalIndex = UNSIGNED_UNSET
 
bool mIsEdgeBasedModel = false
 

Private Member Functions

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

Friends

class boost::serialization::access
 

Detailed Description

The AbstractSrnModel contains basic information to all sub-cellular reaction network (SRN) models.

SRN models are noncopyable since cells are noncopyable.

Definition at line 61 of file AbstractSrnModel.hpp.

Constructor & Destructor Documentation

◆ AbstractSrnModel() [1/2]

AbstractSrnModel::AbstractSrnModel ( const AbstractSrnModel rModel)
protected

Protected copy-constructor for use by CreateSrnModel(). The only way for external code to create a copy of a SRN model is by calling that method, to ensure that a model of the correct subclass is created.

This copy-constructor helps subclasses to ensure that all member variables are correctly copied when this happens.

This method is called by child classes to set member variables for a daughter cell upon cell division. Note that the parent SRN model will have had ResetForDivision() called just before CreateSrnModel() is called, so performing an exact copy of the parent is suitable behaviour. Any daughter-cell-specific initialisation can be done in InitialiseDaughterCell().

Parameters
rModelthe SRN model to copy.

Definition at line 57 of file AbstractSrnModel.cpp.

◆ AbstractSrnModel() [2/2]

AbstractSrnModel::AbstractSrnModel ( )

Sets up a new AbstractSrnModel, gives it a birth time of the current simulation time (which is overwritten by some subclasses)

Definition at line 38 of file AbstractSrnModel.cpp.

◆ ~AbstractSrnModel()

AbstractSrnModel::~AbstractSrnModel ( )
virtual

Base class with virtual methods needs a virtual destructor. The destructor does not delete mpCell. Instead, the cell takes responsibility for deleting the SRN model when it is destroyed.

Definition at line 45 of file AbstractSrnModel.cpp.

Member Function Documentation

◆ AddMergedEdgeSrn()

void AbstractSrnModel::AddMergedEdgeSrn ( AbstractSrnModel pMergedEdgeSrn)
virtual

Adds the merged edge SRN quantities to this edge. This method is virtual and needs to be overriden by user-defined SRN model.

Parameters
pMergedEdgeSrnpointer to an SRN model

Reimplemented in DeltaNotchEdgeSrnModel.

Definition at line 156 of file AbstractSrnModel.cpp.

◆ AddShrunkEdgeSrn()

void AbstractSrnModel::AddShrunkEdgeSrn ( AbstractSrnModel pShrunkEdgeSrn)
virtual

Adds the shrunk edge SRN quantities to this edge. This method is virtual and needs to be overriden by user-defined SRN model.

Parameters
pShrunkEdgeSrnpointer to an SRN model

Reimplemented in DeltaNotchEdgeSrnModel.

Definition at line 152 of file AbstractSrnModel.cpp.

◆ AddShrunkEdgeToInterior()

void AbstractSrnModel::AddShrunkEdgeToInterior ( AbstractSrnModel pShrunkEdgeSrn)
virtual

Adds the shrunk edge SRN quantities to (this) interior SRN. This method is virtual and needs to be overriden by user-defined SRN model.

Parameters
pShrunkEdgeSrnpointer to an SRN model

Reimplemented in DeltaNotchInteriorSrnModel.

Definition at line 159 of file AbstractSrnModel.cpp.

◆ AddSrnQuantities()

void AbstractSrnModel::AddSrnQuantities ( AbstractSrnModel pOtherSrn,
const double  scale = 1.0 
)
virtual

Adds SRN quantities (variables or parameters) to this. The quantities can be scaled by factor scale. This method is virtual and needs to be overriden by user-defined SRN model

Parameters
pOtherSrnpointer to an SRN model
scalescale factor

Reimplemented in DeltaNotchEdgeSrnModel.

Definition at line 147 of file AbstractSrnModel.cpp.

◆ CreateSrnModel()

virtual AbstractSrnModel * AbstractSrnModel::CreateSrnModel ( )
pure virtual

Builder method to create new instances of the SRN model.

As this method is pure virtual, it must be overridden in subclasses.

This method is called by Cell::Divide() to create a SRN model for the daughter cell. Note that the parent SRN model will have had ResetForDivision() called just before CreateSrnModel() is called, so performing an exact copy of the parent is suitable behaviour. Any daughter-cell-specific initialisation can be done in InitialiseDaughterCell().

Copy constructors are used to set all the member variables in the appropriate classes.

Returns
new SRN model

Implemented in CellSrnModel, DeltaNotchEdgeSrnModel, DeltaNotchInteriorSrnModel, DeltaNotchSrnModel, Goldbeter1991SrnModel, and NullSrnModel.

Referenced by Cell::Divide().

◆ GetCell()

CellPtr AbstractSrnModel::GetCell ( )
Returns
The cell which plays host to this SRN model.

Definition at line 88 of file AbstractSrnModel.cpp.

References mpCell.

Referenced by VertexBasedPopulationSrn< DIM >::RemapCellSrn().

◆ GetEdgeLocalIndex()

unsigned AbstractSrnModel::GetEdgeLocalIndex ( )

Gets the local edge index that this SRN object belongs to

Returns

Definition at line 122 of file AbstractSrnModel.cpp.

References mEdgeLocalIndex.

Referenced by DeltaNotchEdgeSrnModel::UpdateDeltaNotch().

◆ GetSimulatedToTime()

double AbstractSrnModel::GetSimulatedToTime ( ) const
Returns
the time the SRN simulated has run to.

Definition at line 99 of file AbstractSrnModel.cpp.

References mSimulatedToTime.

◆ HasEdgeModel()

bool AbstractSrnModel::HasEdgeModel ( ) const

Indicates whether this SRN is part of the model with edge SRNs

Returns
true if edge SRN has been introduced into the model

Definition at line 127 of file AbstractSrnModel.cpp.

References mIsEdgeBasedModel.

Referenced by CellSrnModel::CellSrnModel().

◆ Initialise()

void AbstractSrnModel::Initialise ( )
virtual

Initialise the SRN model at the start of a simulation.

This method will be called precisely once per cell set up in the initial cell population. It is not called on cell division; use ResetForDivision(), CreateSrnModel() and InitialiseDaughterCell() for that.

By the time this is called, a CellPopulation will have been set up, so the model can know where its cell is located in space. If relevant to the simulation, any singletons will also have been initialised.

Reimplemented in AbstractOdeSrnModel, CellSrnModel, DeltaNotchEdgeSrnModel, DeltaNotchInteriorSrnModel, DeltaNotchSrnModel, and Goldbeter1991SrnModel.

Definition at line 49 of file AbstractSrnModel.cpp.

Referenced by Cell::InitialiseSrnModel().

◆ InitialiseDaughterCell()

void AbstractSrnModel::InitialiseDaughterCell ( )
virtual

Initialise the new daughter cell's SRN model after a cell division.

This is called by Cell::Divide() once the new cell object has been fully created, to perform any initialisation of the SRN which requires access to the cell.

Note that much initialisation can be performed using the combination of ResetForDivision() (called on the parent prior to division) and CreateSrnModel() (called on the reset parent to create the new cell-cycle model object).

Reimplemented in DeltaNotchEdgeSrnModel.

Definition at line 53 of file AbstractSrnModel.cpp.

◆ operator=()

AbstractSrnModel & AbstractSrnModel::operator= ( const AbstractSrnModel )
private

Prevent copy-assignment of this class, or its subclasses. Note that we do not define this method, therefore statements like "AbstractSrnModel new = old;" will not compile. We do not inherit from boost::noncopyable because we *do* define a protected copy-constructor, for use by CreateSrnModel.

Returns
the new SRN model.

◆ OutputSrnModelInfo()

void AbstractSrnModel::OutputSrnModelInfo ( out_stream &  rParamsFile)

Output SRN model used in the simulation to file and then call OutputSrnParameters() to output all relevant parameters.

Parameters
rParamsFilethe file stream to which the parameters are output

Definition at line 104 of file AbstractSrnModel.cpp.

References Identifiable::GetIdentifier(), and OutputSrnModelParameters().

◆ OutputSrnModelParameters()

void AbstractSrnModel::OutputSrnModelParameters ( out_stream &  rParamsFile)
virtual

Output SRN model parameters to file.

As this method is pure virtual, it must be overridden in subclasses.

Parameters
rParamsFilethe file stream to which the parameters are output

Reimplemented in AbstractOdeSrnModel, DeltaNotchEdgeSrnModel, DeltaNotchInteriorSrnModel, DeltaNotchSrnModel, and Goldbeter1991SrnModel.

Definition at line 113 of file AbstractSrnModel.cpp.

Referenced by OutputSrnModelInfo(), and AbstractOdeSrnModel::OutputSrnModelParameters().

◆ ResetForDivision()

void AbstractSrnModel::ResetForDivision ( )
virtual

Each SRN model must be able to be reset 'after' a cell division.

Actually, this method is called from Cell::Divide() to reset the SRN just before the daughter cell is created. CreateSrnModel() can then clone our state to generate a cell-cycle model instance for the daughter cell.

Reimplemented in AbstractOdeSrnModel, CellSrnModel, and DeltaNotchInteriorSrnModel.

Definition at line 76 of file AbstractSrnModel.cpp.

References SimulationTime::Instance(), mSimulatedToTime, and SimulateToCurrentTime().

Referenced by Cell::Divide(), and AbstractOdeSrnModel::ResetForDivision().

◆ ScaleSrnVariables()

void AbstractSrnModel::ScaleSrnVariables ( const double  theta)
virtual

Scales SRN variables by factor theta. Method overriden in AbstractOdeSrnModel.

Parameters
thetafactor by which to scale all ODE variables.

Reimplemented in AbstractOdeSrnModel.

Definition at line 143 of file AbstractSrnModel.cpp.

◆ serialize()

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

Archive the SRN model and its member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 74 of file AbstractSrnModel.hpp.

References SerializableSingleton< SINGLETON_CLASS >::GetSerializationWrapper(), SimulationTime::Instance(), mEdgeLocalIndex, mIsEdgeBasedModel, and mSimulatedToTime.

◆ SetCell()

void AbstractSrnModel::SetCell ( CellPtr  pCell)
virtual

Gives the SRN model a pointer to its host cell.

Parameters
pCellpointer to the cell

Reimplemented in CellSrnModel.

Definition at line 83 of file AbstractSrnModel.cpp.

References mpCell.

Referenced by Cell::Cell(), CellSrnModel::SetCell(), and Cell::SetSrnModel().

◆ SetEdgeLocalIndex()

void AbstractSrnModel::SetEdgeLocalIndex ( unsigned  index)

Sets the local edge index that this SRN object belongs to

Parameters
index

Definition at line 117 of file AbstractSrnModel.cpp.

References mEdgeLocalIndex.

◆ SetEdgeModelIndicator()

void AbstractSrnModel::SetEdgeModelIndicator ( const bool  isEdgeModel)

Sets this model to be part of an edge based SRN

Parameters
isEdgeModelwhether this model is part of an edge based SRN

Definition at line 132 of file AbstractSrnModel.cpp.

References mIsEdgeBasedModel.

◆ SetSimulatedToTime()

void AbstractSrnModel::SetSimulatedToTime ( double  simulatedToTime)

Set the time that the SRN simulation has run to.

Parameters
simulatedToTimethe current simulation time of the SRN.

Definition at line 94 of file AbstractSrnModel.cpp.

References mSimulatedToTime.

Referenced by AbstractOdeSrnModel::SimulateToCurrentTime(), and NullSrnModel::SimulateToCurrentTime().

◆ SimulateToCurrentTime()

virtual void AbstractSrnModel::SimulateToCurrentTime ( )
pure virtual

Simulate the SRN to the current time.

As this method is pure virtual, it must be overridden in subclasses.

Implemented in AbstractOdeSrnModel, CellSrnModel, DeltaNotchEdgeSrnModel, DeltaNotchInteriorSrnModel, DeltaNotchSrnModel, Goldbeter1991SrnModel, and NullSrnModel.

Referenced by Cell::ReadyToDivide(), and ResetForDivision().

◆ SplitEdgeSrn()

void AbstractSrnModel::SplitEdgeSrn ( const double  relativePosition)
virtual

Scales SRN quantities due to edge split. Amount of scaling may depend on the resulting proportions, deetermined by relative position of the node that splits the edge. This method is virtual and needs to be overriden by user-defined SRN model.

Parameters
relativePositionhow close the added node is to the previous node

Reimplemented in DeltaNotchEdgeSrnModel.

Definition at line 162 of file AbstractSrnModel.cpp.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 66 of file AbstractSrnModel.hpp.

Member Data Documentation

◆ mEdgeLocalIndex

unsigned AbstractSrnModel::mEdgeLocalIndex = UNSIGNED_UNSET
protected

The local edge index when used as part of a edge-based SRN.

Definition at line 107 of file AbstractSrnModel.hpp.

Referenced by GetEdgeLocalIndex(), serialize(), and SetEdgeLocalIndex().

◆ mIsEdgeBasedModel

bool AbstractSrnModel::mIsEdgeBasedModel = false
protected

Indicates if edge model has been introduced. False by default.

Definition at line 110 of file AbstractSrnModel.hpp.

Referenced by CellSrnModel::CellSrnModel(), CellSrnModel::AddEdgeSrn(), CellSrnModel::AddEdgeSrnModel(), HasEdgeModel(), serialize(), and SetEdgeModelIndicator().

◆ mpCell

◆ mSimulatedToTime


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