copasi API  0.1
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends
CStochMethod Class Reference

#include <CStochMethod.h>

Inheritance diagram for CStochMethod:
CTrajectoryMethod CCopasiMethod CCopasiParameterGroup CCopasiParameter CCopasiContainer CCopasiObject CStochNextReactionMethod

List of all members.

Public Member Functions

 CStochMethod (const CStochMethod &src, const CCopasiContainer *pParent=NULL)
 ~CStochMethod ()
virtual bool elevateChildren ()
virtual Status step (const double &deltaT)
virtual void start (const CState *initialState)
virtual bool isValidProblem (const CCopasiProblem *pProblem)

Protected Member Functions

virtual void initMethod (C_FLOAT64 start_time)=0
virtual C_FLOAT64 doSingleStep (C_FLOAT64 time, C_FLOAT64 endtime)=0
C_INT32 updatePropensities ()
C_INT32 calculateAmu (C_INT32 reaction_index)
C_INT32 generateReactionIndex ()
C_FLOAT64 generateReactionTime ()
C_FLOAT64 generateReactionTime (C_INT32 reaction_index)
C_INT32 updateSystemState (C_INT32 reaction_index)
void setupDependencyGraphAndBalances ()
 CStochMethod (const CCopasiContainer *pParent=NULL)

Static Protected Member Functions

static bool modelHasAssignments (const CModel *pModel)

Protected Attributes

std::vector< C_FLOAT64 > mAmu
C_FLOAT64 mA0
std::vector< C_FLOAT64 > mAmuOld
bool mDoCorrection
bool mHasAssignments
CRandommpRandomGenerator
CModelmpModel
CDependencyGraph mDG
std::vector< std::vector
< CStochBalance > > 
mLocalBalances
std::vector< std::vector
< CStochBalance > > 
mLocalSubstrates
std::vector< C_INT64 > mNumbers
unsigned C_INT32 mNumReactions
unsigned C_INT32 mFirstMetabIndex

Friends

CTrajectoryMethodCTrajectoryMethod::createTrajectoryMethod (CCopasiMethod::SubType subType, CTrajectoryProblem *pProblem)

Constructor & Destructor Documentation

CStochMethod::CStochMethod ( const CCopasiContainer pParent = NULL) [protected]

Default constructor.

Parameters:
constCCopasiContainer * pParent (default: NULL)
CStochMethod::CStochMethod ( const CStochMethod src,
const CCopasiContainer pParent = NULL 
)

Copy constructor.

Parameters:
constCStochMethod & src,
constCCopasiContainer * pParent (Default: NULL)
CStochMethod::~CStochMethod ( )

Destructor.


Member Function Documentation

C_INT32 CStochMethod::calculateAmu ( C_INT32  reaction_index) [protected]

Calculate one of the propensities

Returns:
mFail
See also:
mFail
virtual C_FLOAT64 CStochMethod::doSingleStep ( C_FLOAT64  time,
C_FLOAT64  endtime 
) [protected, pure virtual]

Do one iteration of the simulation

Returns:
Current simulation time or -1 if error.

Implemented in CStochNextReactionMethod.

bool CStochMethod::elevateChildren ( ) [virtual]

This methods must be called to elevate subgroups to derived objects. The default implementation does nothing.

Returns:
bool success

Reimplemented from CCopasiParameterGroup.

C_INT32 CStochMethod::generateReactionIndex ( ) [protected]

Generate the index of a putative reaction.

Returns:
The reaction index
C_FLOAT64 CStochMethod::generateReactionTime ( ) [protected]

Generate the putative time taken before any reaction takes place

Returns:
The time before the reaction
C_FLOAT64 CStochMethod::generateReactionTime ( C_INT32  reaction_index) [protected]

Generate the putative time taken before a special reaction takes place

Returns:
The time before the reaction
virtual void CStochMethod::initMethod ( C_FLOAT64  start_time) [protected, pure virtual]

Initialization.

bool CStochMethod::isValidProblem ( const CCopasiProblem pProblem) [virtual]

Check if the method is suitable for this problem

Returns:
bool suitability of the method

Reimplemented from CTrajectoryMethod.

bool CStochMethod::modelHasAssignments ( const CModel pModel) [static, protected]

tests if the model contains a global value with an assignment rule that is used in calculations

void CStochMethod::setupDependencyGraphAndBalances ( ) [protected]

Set up the dependency graph and the balances

void CStochMethod::start ( const CState initialState) [virtual]

This instructs the method to prepare for integration starting with the initialState given.

Parameters:
const CState *initialState

Reimplemented from CTrajectoryMethod.

CTrajectoryMethod::Status CStochMethod::step ( const double &  deltaT) [virtual]

This instructs the method to calculate a time step of deltaT starting with the current state, i.e., the result of the previous step. The new state (after deltaT) is expected in the current state. The return value is the actual timestep taken.

Parameters:
const double &deltaT
Returns:
Status status

Reimplemented from CTrajectoryMethod.

C_INT32 CStochMethod::updatePropensities ( ) [protected]

Calculate the propensities for all reactions

Returns:
mFail
See also:
mFail
C_INT32 CStochMethod::updateSystemState ( C_INT32  reaction_index) [protected]

Update the particle numbers according to which reaction ocurred

Returns:
mFail
See also:
mFail

Friends And Related Function Documentation

CTrajectoryMethod* CTrajectoryMethod::createTrajectoryMethod ( CCopasiMethod::SubType  subType,
CTrajectoryProblem pProblem 
) [friend]

Member Data Documentation

C_FLOAT64 CStochMethod::mA0 [protected]

The sum of the propensities

std::vector<C_FLOAT64> CStochMethod::mAmu [protected]

The propensities for the reactions

std::vector<C_FLOAT64> CStochMethod::mAmuOld [protected]

The stored propensities for the reactions before the last update

The graph of reactions and their dependent reactions. When a reaction is executed, the propensities for each of its dependents must be updated.

bool CStochMethod::mDoCorrection [protected]

indicates if the correction N^2 -> N*(N-1) should be performed

unsigned C_INT32 CStochMethod::mFirstMetabIndex [protected]

index of first metab in a CState

Indicates whether the model has global quantities with assignment rules. If it has, we will use a less efficient way to update the model state to handle this.

std::vector< std::vector <CStochBalance> > CStochMethod::mLocalBalances [protected]

The balances of the reactions as integers

std::vector< std::vector <CStochBalance> > CStochMethod::mLocalSubstrates [protected]

the substrates of each reaction with their multiplicities

std::vector<C_INT64> CStochMethod::mNumbers [protected]

The particle numbers

unsigned C_INT32 CStochMethod::mNumReactions [protected]

A pointer to the instance of CModel being used.

The random number generator


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines