COPASI API
4.16.103
|
#include <CHybridMethod.h>
Public Member Functions | |
CHybridMethod (const CHybridMethod &src, const CCopasiContainer *pParent=NULL) | |
virtual bool | elevateChildren () |
virtual bool | isValidProblem (const CCopasiProblem *pProblem) |
virtual void | start (const CState *initialState) |
virtual Status | step (const double &deltaT) |
~CHybridMethod () | |
![]() | |
CTrajectoryMethod (const CTrajectoryMethod &src, const CCopasiContainer *pParent=NULL) | |
const CVector< C_INT > & | getRoots () const |
void | setCurrentState (CState *currentState) |
void | setProblem (CTrajectoryProblem *problem) |
virtual void | stateChanged () |
~CTrajectoryMethod () | |
![]() | |
CCopasiMethod (const CCopasiMethod &src, const CCopasiContainer *pParent=NULL) | |
const CCopasiMethod::SubType & | getSubType () const |
const CCopasiTask::Type & | getType () const |
virtual void | load (CReadConfig &configBuffer, CReadConfig::Mode mode=CReadConfig::SEARCH) |
virtual void | print (std::ostream *ostream) const |
virtual void | printResult (std::ostream *ostream) const |
virtual bool | setCallBack (CProcessReport *pCallBack) |
virtual | ~CCopasiMethod () |
![]() | |
bool | addGroup (const std::string &name) |
bool | addParameter (const CCopasiParameter ¶meter) |
bool | addParameter (const std::string &name, const CCopasiParameter::Type type) |
template<class CType > | |
bool | addParameter (const std::string &name, const CCopasiParameter::Type type, const CType &value) |
void | addParameter (CCopasiParameter *pParameter) |
CCopasiParameterGroup * | assertGroup (const std::string &name) |
template<class CType > | |
CCopasiParameter * | assertParameter (const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue) |
index_iterator | beginIndex () const |
name_iterator | beginName () const |
CCopasiParameterGroup (const CCopasiParameterGroup &src, const CCopasiContainer *pParent=NULL) | |
CCopasiParameterGroup (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &objectType="ParameterGroup") | |
void | clear () |
index_iterator | endIndex () const |
name_iterator | endName () const |
CCopasiParameterGroup * | getGroup (const std::string &name) |
const CCopasiParameterGroup * | getGroup (const std::string &name) const |
CCopasiParameterGroup * | getGroup (const size_t &index) |
const CCopasiParameterGroup * | getGroup (const size_t &index) const |
size_t | getIndex (const std::string &name) const |
std::string | getKey (const std::string &name) const |
std::string | getKey (const size_t &index) const |
virtual const std::string & | getName (const size_t &index) const |
virtual const CObjectInterface * | getObject (const CCopasiObjectName &cn) const |
CCopasiParameter * | getParameter (const std::string &name) |
const CCopasiParameter * | getParameter (const std::string &name) const |
CCopasiParameter * | getParameter (const size_t &index) |
const CCopasiParameter * | getParameter (const size_t &index) const |
CCopasiParameter::Type | getType (const std::string &name) const |
CCopasiParameter::Type | getType (const size_t &index) const |
std::string | getUniqueParameterName (const CCopasiParameter *pParameter) const |
const CCopasiParameter::Value & | getValue (const std::string &name) const |
const CCopasiParameter::Value & | getValue (const size_t &index) const |
CCopasiParameter::Value & | getValue (const std::string &name) |
CCopasiParameter::Value & | getValue (const size_t &index) |
CCopasiParameterGroup & | operator= (const CCopasiParameterGroup &rhs) |
bool | removeParameter (const std::string &name) |
bool | removeParameter (const size_t &index) |
template<class CType > | |
bool | setValue (const std::string &name, const CType &value) |
template<class CType > | |
bool | setValue (const size_t &index, const CType &value) |
size_t | size () const |
bool | swap (const size_t &iFrom, const size_t &iTo) |
bool | swap (index_iterator &from, index_iterator &to) |
virtual | ~CCopasiParameterGroup () |
![]() | |
CCopasiParameter (const CCopasiParameter &src, const CCopasiContainer *pParent=NULL) | |
CCopasiParameter (const std::string &name, const Type &type, const void *pValue=NULL, const CCopasiContainer *pParent=NULL, const std::string &objectType="Parameter") | |
virtual CCopasiObjectName | getCN () const |
virtual const std::string & | getKey () const |
virtual std::string | getObjectDisplayName (bool regular=true, bool richtext=false) const |
const CCopasiParameter::Type & | getType () const |
const Value & | getValue () const |
Value & | getValue () |
virtual void * | getValuePointer () const |
CCopasiObject * | getValueReference () const |
bool | isValidValue (const C_FLOAT64 &value) const |
bool | isValidValue (const C_INT32 &value) const |
bool | isValidValue (const unsigned C_INT32 &value) const |
bool | isValidValue (const bool &value) const |
bool | isValidValue (const std::string &value) const |
bool | isValidValue (const CCopasiObjectName &value) const |
bool | isValidValue (const std::vector< CCopasiParameter * > &value) const |
CCopasiParameter & | operator= (const CCopasiParameter &rhs) |
template<class CType > | |
bool | setValue (const CType &value) |
bool | setValue (const std::vector< CCopasiParameter * > &value) |
virtual | ~CCopasiParameter () |
![]() | |
virtual bool | add (CCopasiObject *pObject, const bool &adopt=true) |
CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container) | |
CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL) | |
virtual std::string | getChildObjectUnits (const CCopasiObject *pObject) const |
virtual const objectMap & | getObjects () const |
virtual std::string | getUnits () const |
virtual const CCopasiObject * | getValueObject () const |
virtual bool | remove (CCopasiObject *pObject) |
virtual | ~CCopasiContainer () |
![]() | |
void | addDirectDependency (const CCopasiObject *pObject) |
CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL) | |
void | clearDirectDependencies () |
void | clearRefresh () |
bool | dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const |
void | getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const |
virtual const DataObjectSet & | getDirectDependencies (const DataObjectSet &context=DataObjectSet()) const |
CCopasiContainer * | getObjectAncestor (const std::string &type) const |
CCopasiDataModel * | getObjectDataModel () |
const CCopasiDataModel * | getObjectDataModel () const |
const std::string & | getObjectName () const |
CCopasiContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const |
virtual Refresh * | getRefresh () const |
UpdateMethod * | getUpdateMethod () const |
bool | hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const |
bool | hasUpdateMethod () const |
bool | isArray () const |
bool | isContainer () const |
bool | isDataModel () const |
bool | isMatrix () const |
bool | isNameVector () const |
bool | isNonUniqueName () const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const |
bool | isReference () const |
bool | isRoot () const |
bool | isSeparator () const |
bool | isStaticString () const |
bool | isValueBool () const |
bool | isValueDbl () const |
bool | isValueInt () const |
bool | isValueInt64 () const |
bool | isValueString () const |
bool | isVector () const |
virtual bool | mustBeDeleted (const DataObjectSet &deletedObjects) const |
void | removeDirectDependency (const CCopasiObject *pObject) |
void | setDirectDependencies (const DataObjectSet &directDependencies) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CCopasiContainer *pParent) |
void | setObjectValue (const C_FLOAT64 &value) |
void | setObjectValue (const C_INT32 &value) |
void | setObjectValue (const bool &value) |
template<class CType > | |
void | setRefresh (CType *pType, void(CType::*method)(void)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &)) |
template<class CType > | |
void | setUpdateMethod (CType *pType, void(CType::*method)(const bool &)) |
virtual | ~CCopasiObject () |
![]() | |
CObjectInterface () | |
virtual | ~CObjectInterface () |
Static Public Member Functions | |
static CHybridMethod * | createHybridMethod () |
![]() | |
static CTrajectoryMethod * | createMethod (CCopasiMethod::SubType subType=CCopasiMethod::deterministic) |
![]() | |
static std::vector< Refresh * > | buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet()) |
static void | setRenameHandler (CRenameHandler *rh) |
Protected Types | |
enum | metabStatus { LOW = 0, HIGH } |
![]() | |
enum | Flag { Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8, Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80, ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800, Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000, Root = 0x10000, Gui = 0x20000 } |
Protected Member Functions | |
void | calculateAmu (size_t rIndex) |
void | calculateDerivative (std::vector< C_FLOAT64 > &deriv) |
CHybridMethod (const CCopasiContainer *pParent=NULL) | |
void | cleanup () |
virtual C_FLOAT64 | doSingleStep (C_FLOAT64 currentTime, C_FLOAT64 endTime)=0 |
void | fireReaction (size_t rIndex) |
C_FLOAT64 | generateReactionTime (size_t rIndex) |
std::set< std::string > * | getAffects (size_t rIndex) |
std::set< std::string > * | getDependsOn (size_t rIndex) |
std::set< size_t > * | getParticipatesIn (size_t rIndex) |
void | getState (std::vector< C_FLOAT64 > &target) |
void | getStochTimeAndIndex (C_FLOAT64 &ds, size_t &rIndex) |
void | initMethod (C_FLOAT64 time) |
void | insertDeterministicReaction (size_t rIndex) |
void | integrateDeterministicPart (C_FLOAT64 ds) |
void | integrateDeterministicPartEuler (C_FLOAT64 ds) |
void | outputData (std::ostream &os, C_INT32 mode) |
void | outputDebug (std::ostream &os, size_t level) |
void | partitionSystem () |
void | removeDeterministicReaction (size_t rIndex) |
void | rungeKutta (C_FLOAT64 dt) |
void | setState (std::vector< C_FLOAT64 > &source) |
void | setupBalances () |
void | setupDependencyGraph () |
void | setupMetab2React () |
void | setupMetab2ReactComplete () |
void | setupMetab2ReactPlusModifier () |
void | setupPartition () |
void | setupPriorityQueue (C_FLOAT64 startTime=0.0) |
void | updatePriorityQueue (size_t rIndex, C_FLOAT64 time) |
void | updateTauMu (size_t rIndex, C_FLOAT64 time) |
![]() | |
CTrajectoryMethod (const CCopasiMethod::SubType &subType, const CCopasiContainer *pParent=NULL) | |
![]() | |
CCopasiMethod (const CCopasiTask::Type &taskType, const SubType &subType, const CCopasiContainer *pParent=NULL) | |
![]() | |
CCopasiParameterGroup () | |
![]() | |
template<class CType > | |
CCopasiObject * | addMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
template<class CType > | |
CCopasiObject * | addVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0) |
void | initObjects () |
![]() | |
CCopasiObject () | |
CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0) | |
Static Protected Member Functions | |
static C_INT32 | checkModel (CModel *model) |
static bool | modelHasAssignments (const CModel *pModel) |
Private Member Functions | |
void | initializeParameter () |
Friends | |
CTrajectoryMethod * | CTrajectoryMethod::createMethod (CCopasiMethod::SubType subType) |
Definition at line 113 of file CHybridMethod.h.
|
protected |
Status of the metabolites. Particle number can be high or low.
Enumerator | |
---|---|
LOW | |
HIGH |
Definition at line 462 of file CHybridMethod.h.
CHybridMethod::CHybridMethod | ( | const CHybridMethod & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor
const | CHybridMethod & src |
const | CCopasiContainer * pParent (default: NULL) |
Definition at line 70 of file CHybridMethod.cpp.
References CRandom::createGenerator(), initializeParameter(), mpRandomGenerator, and CRandom::mt19937.
CHybridMethod::~CHybridMethod | ( | ) |
Destructor.
Definition at line 81 of file CHybridMethod.cpp.
References cleanup(), and DESTRUCTOR_TRACE.
|
protected |
Default constructor.
const | CCopasiContainer * pParent (default: NULL) |
This class implements an hybrid algorithm for the simulation of a biochemical system over time.
File name: CHybridMethod.cpp Author: Juergen Pahle Email: juerg en.p ahle@ eml- r.vil la-b osch. de
Last change: 14, December 2004
(C) European Media Lab 2003. Default constructor.
Definition at line 63 of file CHybridMethod.cpp.
References CRandom::createGenerator(), initializeParameter(), mpRandomGenerator, and CRandom::mt19937.
|
protected |
Calculates an amu value for a given reaction.
rIndex | A size_t specifying the reaction to be updated |
Definition at line 691 of file CHybridMethod.cpp.
References C_FLOAT64, C_INT32, C_INT64, CCopasiParameter::getValue(), mAmu, mDoCorrection, mLocalSubstrates, and mpMetabolites.
Referenced by partitionSystem(), setupPriorityQueue(), and updatePriorityQueue().
Calculates the derivative of the system and writes it into the vector deriv. Length of deriv must be mNumVariableMetabs. CAUTION: Only deterministic reactions are taken into account. That is, this is only the derivative of the deterministic part of the system.
deriv | A vector reference of length mNumVariableMetabs, into which the derivative is written |
Definition at line 489 of file CHybridMethod.cpp.
References C_INT32, mFirstReactionFlag, CHybridStochFlag::mIndex, CHybridStochFlag::mpNext, mStoi, and CMatrix< CType >::numRows().
Referenced by integrateDeterministicPartEuler(), and rungeKutta().
Test the model if it is proper to perform stochastic simulations on. Several properties are tested (e.g. integer stoichometry, all reactions take place in one compartment only, irreversibility...).
model | The model to be checked |
Test the model if it is proper to perform stochastic simulations on. Several properties are tested (e.g. integer stoichometry, all reactions take place in one compartment only, irreversibility...).
Definition at line 804 of file CHybridMethod.cpp.
References C_FLOAT64, C_INT32, CModel::getReactions(), CModel::getStoi(), INT_EPSILON, mpReactions, mStoi, CMatrix< CType >::numRows(), and CCopasiVector< T >::size().
|
protected |
Cleans up memory, etc.
Definition at line 319 of file CHybridMethod.cpp.
References mpModel, and mpRandomGenerator.
Referenced by ~CHybridMethod().
|
static |
Creates a HybridMethod adequate for the problem. (only CHybridNextReactionRKMethod so far)
Definition at line 153 of file CHybridMethod.cpp.
References C_INT32.
Referenced by CTrajectoryMethod::createMethod().
|
protectedpure virtual |
Simulates the system over the next interval of time. The current time and the end time of the current step() are given as arguments.
currentTime | A C_FLOAT64 specifying the current time |
endTime | A C_FLOAT64 specifying the end time of the step() |
Implemented in CHybridNextReactionRKMethod.
Referenced by step().
|
virtual |
This methods must be called to elevate subgroups to derived objects. The default implementation does nothing.
Reimplemented from CCopasiParameterGroup.
Definition at line 143 of file CHybridMethod.cpp.
References initializeParameter().
|
protected |
Executes the specified reaction in the system once.
rIndex | A size_t specifying the index of the reaction, which will be fired. |
Executes the specified reaction in the system once.
rIndex | A size_t specifying the index of the reaction, which will be fired. |
time | The current time |
Definition at line 588 of file CHybridMethod.cpp.
References C_FLOAT64, CDependencyGraph::getDependents(), CModelEntity::getValue(), mDG, mLocalBalances, mUpdateSet, CMetab::refreshConcentration(), and CModelEntity::setValue().
Referenced by CHybridNextReactionRKMethod::doSingleStep().
|
protected |
Generates a putative reaction time for the given reaction.
rIndex | A size_t specifying the index of the reaction |
Definition at line 678 of file CHybridMethod.cpp.
References C_FLOAT64, CRandom::getRandomOO(), mAmu, and mpRandomGenerator.
Referenced by partitionSystem(), setupPriorityQueue(), updatePriorityQueue(), and updateTauMu().
|
protected |
Gets the set of metabolites which change number when a given reaction is executed.
rIndex | The index of the reaction being executed. |
Definition at line 1331 of file CHybridMethod.cpp.
References mLocalBalances.
Referenced by setupDependencyGraph().
|
protected |
Gets the set of metabolites on which a given reaction depends.
rIndex | The index of the reaction being executed. |
Definition at line 1298 of file CHybridMethod.cpp.
References mpReactions, and CFunctionParameter::PARAMETER.
Referenced by setupDependencyGraph().
|
protected |
Gets the set of metabolites, which participate in the given reaction either as substrate, product or modifier.
rIndex | The index of the reaction being executed. |
Definition at line 1357 of file CHybridMethod.cpp.
Referenced by setupMetab2ReactPlusModifier().
Gathers the state of the system into the array target. Later on CState should be used for this. Length of the array target must be mNumVariableMetabs.
target | A vector reference of length mNumVariableMetabs, into which the state of the system is written |
Gathers the state of the system into the array target. Later on CState should be used for this. Length of the array target must be mNumVariableMetabs.
target | An array of C_FLOAT64s with length mNumVariableMetabs, into which the state of the system is written |
Definition at line 529 of file CHybridMethod.cpp.
References mNumVariableMetabs.
Referenced by integrateDeterministicPartEuler(), and rungeKutta().
Find the reaction index and the reaction time of the stochastic (!) reaction with the lowest reaction time.
ds | A reference to a C_FLOAT64. The putative reaction time for the first stochastic reaction is written into this variable. |
rIndex | A reference to a size_t. The index of the first stochastic reaction is written into this variable. |
Definition at line 574 of file CHybridMethod.cpp.
References mPQ, CIndexedPriorityQueue::topIndex(), and CIndexedPriorityQueue::topKey().
Referenced by CHybridNextReactionRKMethod::doSingleStep().
|
private |
Intialize the method parameter
Definition at line 87 of file CHybridMethod.cpp.
References CCopasiParameterGroup::assertParameter(), CCopasiParameter::BOOL, C_FLOAT64, C_INT32, CCopasiParameter::DOUBLE, CCopasiParameterGroup::getParameter(), CCopasiParameter::getValue(), CCopasiParameter::INT, LOWER_STOCH_LIMIT, MAX_STEPS, PARTITIONING_INTERVAL, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pINT, CCopasiParameter::Value::pUINT, RANDOM_SEED, CCopasiParameterGroup::removeParameter(), RUNGE_KUTTA_STEPSIZE, CCopasiParameterGroup::setValue(), CCopasiParameter::UINT, UPPER_STOCH_LIMIT, and USE_RANDOM_SEED.
Referenced by CHybridMethod(), and elevateChildren().
Initializes the solver.
time | the current time |
Initializes the solver and sets the model to be used.
model | A reference to an instance of a CModel |
Definition at line 264 of file CHybridMethod.cpp.
References currentState, CModel::getMetabolitesX(), CModel::getNumDependentReactionMetabs(), CModel::getNumIndependentReactionMetabs(), CModel::getReactions(), CModel::getStoi(), CCopasiParameter::getValue(), CRandom::initialize(), k1, k2, k3, k4, mAmu, mAmuOld, mLowerStochLimit, mMaxSteps, mMaxStepsReached, mNumVariableMetabs, mPartitioningInterval, mpMetabolites, mpModel, mpRandomGenerator, mpReactions, mRandomSeed, mStepsAfterPartitionSystem, mStepsize, mStoi, mUpdateSet, mUpperStochLimit, mUseRandomSeed, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pINT, CCopasiParameter::Value::pUINT, setupBalances(), setupDependencyGraph(), setupMetab2React(), setupPartition(), setupPriorityQueue(), CCopasiVector< T >::size(), and temp.
Referenced by start().
|
protected |
Inserts a new deterministic reaction into the linked list in the vector mReactionFlags.
rIndex | A size_t giving the index of the reaction to be inserted into the list of deterministic reactions. |
Inserts a new deterministic reaction into the linked list in the array mReactionFlags.
rIndex | A size_t giving the index of the reaction to be inserted into the list of deterministic reactions. |
Definition at line 1224 of file CHybridMethod.cpp.
References mAmu, mAmuOld, mFirstReactionFlag, CHybridStochFlag::mpPrev, and mReactionFlags.
Referenced by partitionSystem().
Integrates the deterministic reactions of the system over the specified time interval.
ds | A C_FLOAT64 specifying the stepsize. |
Definition at line 335 of file CHybridMethod.cpp.
References C_FLOAT64, CDependencyGraph::getDependents(), mDG, mFirstReactionFlag, CHybridStochFlag::mIndex, CHybridStochFlag::mpNext, mStepsize, mUpdateSet, and rungeKutta().
Referenced by CHybridNextReactionRKMethod::doSingleStep().
Integrates the deterministic reactions of the system over the specified time interval.
ds | A C_FLOAT64 specifying the stepsize. |
Definition at line 367 of file CHybridMethod.cpp.
References C_FLOAT64, calculateDerivative(), currentState, CDependencyGraph::getDependents(), getState(), mDG, mFirstReactionFlag, CHybridStochFlag::mIndex, mNumVariableMetabs, CHybridStochFlag::mpNext, mStepsize, mUpdateSet, setState(), and temp.
|
virtual |
Check if the method is suitable for this problem
Reimplemented from CTrajectoryMethod.
Definition at line 1714 of file CHybridMethod.cpp.
References CModelEntity::ASSIGNMENT, CCopasiMessage::ERROR, CModel::getCompartments(), CTrajectoryProblem::getDuration(), CModel::getEvents(), CModel::getMetabolites(), CCopasiProblem::getModel(), CModel::getModelValues(), CModel::getNumMetabs(), CModel::getNumModelValues(), CModel::getTotSteps(), CCopasiParameter::getValue(), CTrajectoryMethod::isValidProblem(), MCTrajectoryMethod, mLowerStochLimit, mUpperStochLimit, CModelEntity::ODE, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pINT, CCopasiVector< T >::size(), and CModel::suitableForStochasticSimulation().
|
staticprotected |
tests if the model contains a global value with an assignment rule that is used in calculations
Definition at line 1844 of file CHybridMethod.cpp.
References CModelEntity::ASSIGNMENT, CModel::getCompartments(), CModel::getMetabolites(), CModel::getModelValues(), CModel::getNumMetabs(), CModel::getNumModelValues(), and CCopasiVector< T >::size().
Referenced by start().
Prints out data on standard output.
Prints out data on standard output. Deprecated.
Definition at line 1366 of file CHybridMethod.cpp.
References C_INT32, CState::getTime(), mOutputCounter, CTrajectoryMethod::mpCurrentState, mpMetabolites, and CCopasiVector< T >::size().
|
protected |
Prints out various data on standard output for debugging purposes.
Definition at line 1411 of file CHybridMethod.cpp.
References currentState, CCopasiObject::getObjectName(), CState::getTime(), k1, k2, k3, k4, LOW, mAmu, mAmuOld, mDG, mFirstReactionFlag, mLocalBalances, mLocalSubstrates, mLowerStochLimit, mMaxBalance, mMaxIntBeforeStep, mMaxSteps, mMetab2React, mMetabFlags, mNumVariableMetabs, mPartitioningInterval, CTrajectoryMethod::mpCurrentState, mpMetabolites, mPQ, mpRandomGenerator, mpReactions, mReactionFlags, mStepsAfterPartitionSystem, mStepsize, mStoi, mUpdateSet, mUpperStochLimit, CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), CCopasiVector< T >::size(), and temp.
|
protected |
Updates the partitioning of the system depending on the particle numbers present.
Definition at line 1162 of file CHybridMethod.cpp.
References C_FLOAT64, calculateAmu(), generateReactionTime(), CState::getTime(), CCopasiParameter::getValue(), HIGH, insertDeterministicReaction(), CIndexedPriorityQueue::insertStochReaction(), LOW, mAmu, mAmuOld, mLowerStochLimit, mMetab2React, mMetabFlags, mNumVariableMetabs, CTrajectoryMethod::mpCurrentState, mpMetabolites, mPQ, mReactionFlags, mUpperStochLimit, CCopasiParameter::mValue, removeDeterministicReaction(), and CIndexedPriorityQueue::removeStochReaction().
Referenced by CHybridNextReactionRKMethod::doSingleStep().
|
protected |
Removes a deterministic reaction from the linked list in the vector mReactionFlags.
rIndex | A size_t giving the index of the reaction to be removed from the list of deterministic reactions. |
Removes a deterministic reaction from the linked list in the array mReactionFlags.
rIndex | A size_t giving the index of the reaction to be removed from the list of deterministic reactions. |
Definition at line 1259 of file CHybridMethod.cpp.
References mFirstReactionFlag, CHybridStochFlag::mpPrev, and mReactionFlags.
Referenced by partitionSystem().
Does one 4th order RungeKutta step to integrate the system numerically.
dt | A C_FLOAT64 specifying the stepsize |
result | A reference to a vector, into which the result, that is the increment vector, will be written |
Definition at line 412 of file CHybridMethod.cpp.
References calculateDerivative(), currentState, getState(), k1, k2, k3, k4, mNumVariableMetabs, setState(), and temp.
Referenced by integrateDeterministicPart().
Writes the state specified in the array source into the model. Length of the vector source must be mNumVariableMetabs. (Number of non-fixed metabolites in the model).
source | A vector reference with length mNumVariableMetabs, holding the state of the system to be set in the model |
Writes the state specified in the vector source into the model. Length of the vector source must be mNumVariableMetabs. (Number of non-fixed metabolites in the model).
source | A vector reference with length mNumVariableMetabs, holding the state of the system to be set in the model |
Definition at line 549 of file CHybridMethod.cpp.
References mNumVariableMetabs, mpModel, and CModel::updateSimulatedValues().
Referenced by integrateDeterministicPartEuler(), and rungeKutta().
|
protected |
Sets up an internal representation of the balances for each reaction. This is done in order to be able to deal with fixed metabolites and to avoid a time consuming search for the indices of metabolites in the model.
Definition at line 845 of file CHybridMethod.cpp.
References C_INT32, CModelEntity::FIXED, CCopasiVector< T >::getIndex(), CModel::getMetabolitesX(), CModelEntity::getStatus(), CHybridBalance::mIndex, mLocalBalances, mLocalSubstrates, mMaxBalance, mMaxIntBeforeStep, mMaxSteps, CHybridBalance::mMultiplicity, CHybridBalance::mpMetabolite, mpModel, mpReactions, and CCopasiVector< T >::size().
Referenced by initMethod().
|
protected |
Sets up the dependency graph
Sets up the dependency graph.
Definition at line 900 of file CHybridMethod.cpp.
References CDependencyGraph::addDependent(), CDependencyGraph::clear(), getAffects(), getDependsOn(), mDG, mpReactions, and CCopasiVector< T >::size().
Referenced by initMethod().
|
protected |
Creates for each metabolite a set of reaction indices. If the metabolite participates in a reaction as substrate or product this reaction is added to the corresponding set.
Creates for each metabolite a set of reaction indices. If the metabolite participates in a reaction as substrate or product (that means: balance != 0) this reaction is added to the corresponding set.
Definition at line 964 of file CHybridMethod.cpp.
References mLocalBalances, mMetab2React, mpMetabolites, and CCopasiVector< T >::size().
Referenced by initMethod().
|
protected |
Creates for each metabolite a set of reaction indices. Each reaction is dependent on each metabolite resulting in a complete switch.
Definition at line 1030 of file CHybridMethod.cpp.
References mMetab2React, mpMetabolites, mpReactions, and CCopasiVector< T >::size().
|
protected |
Creates for each metabolite a set of reaction indices. If the metabolite participates in a reaction as substrate, product or modifier this reaction is added to the corresponding set.
Definition at line 993 of file CHybridMethod.cpp.
References getParticipatesIn(), mMetab2React, mpMetabolites, mpReactions, and CCopasiVector< T >::size().
|
protected |
Creates an initial partitioning of the system. Deterministic and stochastic reactions are determined. The array mStochReactions is initialized.
Creates an initial partitioning of the system. Deterministic and stochastic reactions are determined. The vector mReactionFlags and the vector mMetabFlags are initialized.
Definition at line 1055 of file CHybridMethod.cpp.
References C_FLOAT64, CCopasiParameter::getValue(), HIGH, LOW, mFirstReactionFlag, mLocalBalances, mLowerStochLimit, mMetabFlags, mNumVariableMetabs, mpMetabolites, CHybridStochFlag::mpNext, mReactionFlags, mUpperStochLimit, and CCopasiParameter::mValue.
Referenced by initMethod().
Sets up the priority queue.
startTime | The time at which the simulation starts. |
Definition at line 1135 of file CHybridMethod.cpp.
References C_FLOAT64, calculateAmu(), CIndexedPriorityQueue::clear(), generateReactionTime(), CIndexedPriorityQueue::initializeIndexPointer(), CIndexedPriorityQueue::insertStochReaction(), mPQ, mpReactions, mReactionFlags, and CCopasiVector< T >::size().
Referenced by initMethod().
This instructs the method to prepare for integration starting with the initialState given.
const CState * | initialState |
Reimplemented from CTrajectoryMethod.
Definition at line 230 of file CHybridMethod.cpp.
References CModel::deterministic, CStateTemplate::getIndex(), CModel::getMetabolitesX(), CCopasiProblem::getModel(), CModel::getModelType(), CModel::getStateTemplate(), CState::getTime(), initMethod(), mDoCorrection, mFirstMetabIndex, mHasAssignments, modelHasAssignments(), CTrajectoryMethod::mpCurrentState, mpModel, CTrajectoryMethod::mpProblem, CModel::setState(), and CModel::updateSimulatedValues().
|
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.
const double & | deltaT |
Reimplemented from CTrajectoryMethod.
Definition at line 184 of file CHybridMethod.cpp.
References CState::beginIndependent(), C_FLOAT64, doSingleStep(), CModel::getMetabolitesX(), CCopasiProblem::getModel(), CModel::getNumVariableMetabs(), CState::getTime(), mFirstMetabIndex, mMaxIntBeforeStep, mMaxSteps, mMaxStepsReached, CTrajectoryMethod::mpCurrentState, CTrajectoryMethod::mpProblem, CTrajectoryMethod::NORMAL, CState::setTime(), and CCopasiMessage::WARNING.
Updates the priority queue.
rIndex | A size_t giving the index of the fired reaction |
time | A C_FLOAT64 holding the time taken by this reaction |
Updates the priority queue.
rIndex | A size_t giving the index of the fired reaction (-1, if no stochastic reaction has fired) |
time | A C_FLOAT64 holding the current time |
Definition at line 625 of file CHybridMethod.cpp.
References C_FLOAT64, C_INVALID_INDEX, calculateAmu(), generateReactionTime(), mAmu, mAmuOld, mHasAssignments, mpModel, mPQ, mpReactions, mReactionFlags, mUpdateSet, CCopasiVector< T >::size(), CIndexedPriorityQueue::updateNode(), CModel::updateSimulatedValues(), and updateTauMu().
Referenced by CHybridNextReactionRKMethod::doSingleStep().
Updates the putative reaction time of a stochastic reaction in the priority queue. The corresponding amu and amu_old must be set prior to the call of this method.
rIndex | A size_t specifying the index of the reaction |
time | A C_FLOAT64 specifying the current time |
Updates the putative reaction time of a stochastic reaction in the priority queue. The corresponding amu and amu_old must be set prior to the call of this method.
rIndex | A size_t specifying the index of the reaction |
Definition at line 772 of file CHybridMethod.cpp.
References C_FLOAT64, generateReactionTime(), CIndexedPriorityQueue::getKey(), mAmu, mAmuOld, mPQ, and CIndexedPriorityQueue::updateNode().
Referenced by updatePriorityQueue().
|
friend |
|
protected |
Definition at line 531 of file CHybridMethod.h.
Referenced by initMethod(), integrateDeterministicPartEuler(), outputDebug(), and rungeKutta().
|
protected |
Definition at line 532 of file CHybridMethod.h.
Referenced by initMethod(), outputDebug(), and rungeKutta().
|
protected |
Definition at line 533 of file CHybridMethod.h.
Referenced by initMethod(), outputDebug(), and rungeKutta().
|
protected |
Definition at line 534 of file CHybridMethod.h.
Referenced by initMethod(), outputDebug(), and rungeKutta().
|
protected |
Definition at line 535 of file CHybridMethod.h.
Referenced by initMethod(), outputDebug(), and rungeKutta().
|
protected |
The propensities of the stochastic reactions.
Definition at line 593 of file CHybridMethod.h.
Referenced by calculateAmu(), generateReactionTime(), initMethod(), insertDeterministicReaction(), outputDebug(), partitionSystem(), updatePriorityQueue(), and updateTauMu().
|
protected |
Definition at line 594 of file CHybridMethod.h.
Referenced by initMethod(), insertDeterministicReaction(), outputDebug(), partitionSystem(), updatePriorityQueue(), and updateTauMu().
|
protected |
The graph of reactions and their dependent reactions. When a reaction is executed, the propensities for each of its dependents must be updated.
Definition at line 610 of file CHybridMethod.h.
Referenced by fireReaction(), integrateDeterministicPart(), integrateDeterministicPartEuler(), outputDebug(), and setupDependencyGraph().
|
protected |
indicates if the correction N^2 -> N*(N-1) should be performed
Definition at line 510 of file CHybridMethod.h.
Referenced by calculateAmu(), and start().
|
protected |
index of the first metab in CState
Definition at line 477 of file CHybridMethod.h.
|
protected |
Definition at line 543 of file CHybridMethod.h.
Referenced by calculateDerivative(), CHybridNextReactionRKMethod::doSingleStep(), insertDeterministicReaction(), integrateDeterministicPart(), integrateDeterministicPartEuler(), outputDebug(), removeDeterministicReaction(), and setupPartition().
|
protected |
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.
Definition at line 642 of file CHybridMethod.h.
Referenced by start(), and updatePriorityQueue().
|
protected |
Internal representation of the balances of each reaction. The index of each metabolite in the reaction is provided.
Definition at line 555 of file CHybridMethod.h.
Referenced by fireReaction(), getAffects(), outputDebug(), setupBalances(), setupMetab2React(), and setupPartition().
|
protected |
Internal representation of the substrates of each reaction. The index of each substrate-metabolite is provided.
Definition at line 561 of file CHybridMethod.h.
Referenced by calculateAmu(), outputDebug(), and setupBalances().
|
protected |
Limit for particle numbers. If a particle number is < StochLimit the corresponding reactions must be simulated stochastically.
Definition at line 567 of file CHybridMethod.h.
Referenced by initMethod(), isValidProblem(), outputDebug(), partitionSystem(), and setupPartition().
|
protected |
maximal increase of a particle number in one step.
Definition at line 500 of file CHybridMethod.h.
Referenced by outputDebug(), and setupBalances().
|
protected |
This is set to maxint - mMaxSteps*mMaxBalance
Definition at line 505 of file CHybridMethod.h.
Referenced by outputDebug(), setupBalances(), and step().
|
protected |
Max number of doSingleStep() per step()
Definition at line 482 of file CHybridMethod.h.
Referenced by initMethod(), outputDebug(), setupBalances(), and step().
|
protected |
Definition at line 484 of file CHybridMethod.h.
Referenced by initMethod(), and step().
|
protected |
Vector of relations between metabolites to reactions.
Definition at line 588 of file CHybridMethod.h.
Referenced by outputDebug(), partitionSystem(), setupMetab2React(), setupMetab2ReactComplete(), and setupMetab2ReactPlusModifier().
|
protected |
Vector holding information on the status of metabolites. They can have low or high particle numbers.
Definition at line 549 of file CHybridMethod.h.
Referenced by outputDebug(), partitionSystem(), and setupPartition().
|
protected |
Dimension of the system. Total number of metabolites.
Definition at line 472 of file CHybridMethod.h.
Referenced by getState(), initMethod(), integrateDeterministicPartEuler(), outputDebug(), partitionSystem(), rungeKutta(), setState(), and setupPartition().
|
protected |
|
protected |
File output stream to write data.
Definition at line 625 of file CHybridMethod.h.
|
protected |
Output filename.
Definition at line 630 of file CHybridMethod.h.
|
protected |
The system gets repartitioned after this number of elementary steps.
Definition at line 573 of file CHybridMethod.h.
Referenced by CHybridNextReactionRKMethod::doSingleStep(), initMethod(), and outputDebug().
|
protected |
A pointer to the metabolites of the model.
Definition at line 520 of file CHybridMethod.h.
Referenced by calculateAmu(), initMethod(), outputData(), outputDebug(), partitionSystem(), setupMetab2React(), setupMetab2ReactComplete(), setupMetab2ReactPlusModifier(), and setupPartition().
|
protected |
Pointer to the model
Definition at line 467 of file CHybridMethod.h.
Referenced by cleanup(), initMethod(), setState(), setupBalances(), start(), and updatePriorityQueue().
|
protected |
The set of putative stochastic (!) reactions and associated times at which each reaction occurs. This is represented as a priority queue, sorted by the reaction time. This heap changes dynamically as stochastic reactions become deterministic (delete this reaction from the queue) or vice versa (insert a new reaction into the queue).
Definition at line 619 of file CHybridMethod.h.
Referenced by CHybridNextReactionRKMethod::doSingleStep(), getStochTimeAndIndex(), outputDebug(), partitionSystem(), setupPriorityQueue(), updatePriorityQueue(), and updateTauMu().
|
protected |
The random number generator.
Definition at line 604 of file CHybridMethod.h.
Referenced by CHybridMethod(), cleanup(), generateReactionTime(), initMethod(), and outputDebug().
|
protected |
A pointer to the reactions of the model.
Definition at line 515 of file CHybridMethod.h.
Referenced by checkModel(), getDependsOn(), initMethod(), outputDebug(), setupBalances(), setupDependencyGraph(), setupMetab2ReactComplete(), setupMetab2ReactPlusModifier(), setupPriorityQueue(), and updatePriorityQueue().
|
protected |
|
protected |
Vector to hold information about how many metabolites of a reaction have low particle numbers. If no metabolite of one reaction has low particle numbers this reaction will be simulated det.
Definition at line 542 of file CHybridMethod.h.
Referenced by insertDeterministicReaction(), outputDebug(), partitionSystem(), removeDeterministicReaction(), setupPartition(), setupPriorityQueue(), and updatePriorityQueue().
|
protected |
Number of elementary steps after the last partitioning.
Definition at line 578 of file CHybridMethod.h.
Referenced by CHybridNextReactionRKMethod::doSingleStep(), initMethod(), and outputDebug().
|
protected |
Stepsize for the rungeKutta steps of the numerical integrator.
Definition at line 583 of file CHybridMethod.h.
Referenced by CHybridNextReactionRKMethod::doSingleStep(), initMethod(), integrateDeterministicPart(), integrateDeterministicPartEuler(), and outputDebug().
The stoichometry matrix of the model.
Definition at line 525 of file CHybridMethod.h.
Referenced by calculateDerivative(), checkModel(), initMethod(), and outputDebug().
|
protected |
Set of the reactions, which must be updated.
Definition at line 599 of file CHybridMethod.h.
Referenced by fireReaction(), initMethod(), integrateDeterministicPart(), integrateDeterministicPartEuler(), outputDebug(), and updatePriorityQueue().
|
protected |
Definition at line 568 of file CHybridMethod.h.
Referenced by initMethod(), isValidProblem(), outputDebug(), partitionSystem(), and setupPartition().
|
protected |
Specifies if the mRandomSeed should be used. otherwise a randomly chosen seed is used.
Definition at line 490 of file CHybridMethod.h.
Referenced by initMethod().
|
protected |
Vectors to hold the system state and intermediate results
Definition at line 530 of file CHybridMethod.h.
Referenced by initMethod(), integrateDeterministicPartEuler(), outputDebug(), and rungeKutta().