COPASI API
4.16.103
|
#include <CHybridMethodLSODA.h>
Classes | |
struct | Data |
Public Member Functions | |
CHybridMethodLSODA (const CHybridMethodLSODA &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) |
~CHybridMethodLSODA () | |
![]() | |
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 CHybridMethodLSODA * | createHybridMethodLSODA () |
![]() | |
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) |
CHybridMethodLSODA (const CCopasiContainer *pParent=NULL) | |
void | cleanup () |
virtual C_FLOAT64 | doSingleStep (C_FLOAT64 currentTime, C_FLOAT64 endTime)=0 |
void | evalF (const C_FLOAT64 *t, const C_FLOAT64 *y, C_FLOAT64 *ydot) |
void | fireReaction (size_t rIndex) |
C_FLOAT64 | generateReactionTime (size_t rIndex) |
std::set< std::string > * | getAffects (size_t rIndex) |
C_FLOAT64 | getDefaultAtol (const CModel *pModel) const |
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 | outputData (std::ostream &os, C_INT32 mode) |
void | outputDebug (std::ostream &os, size_t level) |
void | partitionSystem () |
void | removeDeterministicReaction (size_t rIndex) |
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 void | EvalF (const C_INT *n, const C_FLOAT64 *t, const C_FLOAT64 *y, C_FLOAT64 *ydot) |
static bool | modelHasAssignments (const CModel *pModel) |
Private Member Functions | |
void | initializeParameter () |
Friends | |
CTrajectoryMethod * | CTrajectoryMethod::createMethod (CCopasiMethod::SubType subType) |
Definition at line 118 of file CHybridMethodLSODA.h.
|
protected |
Status of the metabolites. Particle number can be high or low.
Enumerator | |
---|---|
LOW | |
HIGH |
Definition at line 476 of file CHybridMethodLSODA.h.
CHybridMethodLSODA::CHybridMethodLSODA | ( | const CHybridMethodLSODA & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor
const | CHybridMethodLSODA & src |
const | CCopasiContainer * pParent (default: NULL) |
Definition at line 74 of file CHybridMethodLSODA.cpp.
References CRandom::createGenerator(), CHybridMethodLSODA::Data::dim, initializeParameter(), mData, mpRandomGenerator, CRandom::mt19937, and CHybridMethodLSODA::Data::pMethod.
CHybridMethodLSODA::~CHybridMethodLSODA | ( | ) |
Destructor.
Definition at line 89 of file CHybridMethodLSODA.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: CHybridMethodLSODA.cpp Author: Juergen Pahle Email: juerg en.p ahle@ eml- r.vil la-b osch. de
Last change: 09, May 2006
(C) European Media Lab 2003. Default constructor.
Definition at line 63 of file CHybridMethodLSODA.cpp.
References CRandom::createGenerator(), CHybridMethodLSODA::Data::dim, initializeParameter(), mData, mpRandomGenerator, CRandom::mt19937, and CHybridMethodLSODA::Data::pMethod.
|
protected |
Calculates an amu value for a given reaction.
rIndex | A size_t specifying the reaction to be updated |
Definition at line 706 of file CHybridMethodLSODA.cpp.
References C_FLOAT64, C_INT32, mAmu, mDoCorrection, and mLocalSubstrates.
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 542 of file CHybridMethodLSODA.cpp.
References C_INT32, mFirstReactionFlag, CHybridLSODAStochFlag::mIndex, CHybridLSODAStochFlag::mpNext, mStoi, and CMatrix< CType >::numRows().
Referenced by evalF().
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 819 of file CHybridMethodLSODA.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 382 of file CHybridMethodLSODA.cpp.
References mpModel, and mpRandomGenerator.
Referenced by ~CHybridMethodLSODA().
|
static |
Creates a HybridMethod adequate for the problem. (only CHybridNextReactionLSODAMethod so far)
Creates a HybridMethodLSODA adequate for the problem.
Definition at line 175 of file CHybridMethodLSODA.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 CHybridNextReactionLSODAMethod.
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 166 of file CHybridMethodLSODA.cpp.
References initializeParameter().
|
staticprotected |
Definition at line 392 of file CHybridMethodLSODA.cpp.
References evalF(), and CHybridMethodLSODA::Data::pMethod.
Referenced by integrateDeterministicPart().
|
protected |
This evaluates the derivatives for the complete model
Definition at line 395 of file CHybridMethodLSODA.cpp.
References calculateDerivative(), CCopasiProblem::getModel(), mNumVariableMetabs, CTrajectoryMethod::mpProblem, mpState, CModel::setState(), CState::setTime(), temp, and CModel::updateSimulatedValues().
Referenced by EvalF().
|
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 600 of file CHybridMethodLSODA.cpp.
References C_FLOAT64, CDependencyGraph::getDependents(), CModelEntity::getValue(), mDG, mLocalBalances, mRestartLSODA, mUpdateSet, CMetab::refreshConcentration(), and CModelEntity::setValue().
Referenced by CHybridNextReactionLSODAMethod::doSingleStep().
|
protected |
Generates a putative reaction time for the given reaction.
rIndex | A size_t specifying the index of the reaction |
Definition at line 693 of file CHybridMethodLSODA.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 1349 of file CHybridMethodLSODA.cpp.
References mLocalBalances.
Referenced by setupDependencyGraph().
Calculate the default absolute tolerance
const | CModel * pModel |
Definition at line 361 of file CHybridMethodLSODA.cpp.
References C_FLOAT64, CModel::getCompartments(), CModel::getQuantity2NumberFactor(), CCopasiParameter::getValue(), max, and CCopasiVector< T >::size().
Referenced by initMethod().
|
protected |
Gets the set of metabolites on which a given reaction depends.
rIndex | The index of the reaction being executed. |
Definition at line 1316 of file CHybridMethodLSODA.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 1375 of file CHybridMethodLSODA.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 |
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 586 of file CHybridMethodLSODA.cpp.
References mPQ, CIndexedPriorityQueue::topIndex(), and CIndexedPriorityQueue::topKey().
Referenced by CHybridNextReactionLSODAMethod::doSingleStep().
|
private |
Intialize the method parameter
Definition at line 95 of file CHybridMethodLSODA.cpp.
References CCopasiParameterGroup::addParameter(), CCopasiParameterGroup::assertParameter(), CCopasiParameter::BOOL, C_FLOAT64, C_INT32, CCopasiParameter::DOUBLE, CCopasiParameterGroup::getParameter(), CCopasiParameter::getValue(), LOWER_STOCH_LIMIT, MAX_STEPS, PARTITIONING_INTERVAL, PARTITIONING_STEPSIZE, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pUINT, RANDOM_SEED, CCopasiParameterGroup::removeParameter(), CCopasiParameterGroup::setValue(), CCopasiParameter::UDOUBLE, CCopasiParameter::UINT, UPPER_STOCH_LIMIT, and USE_RANDOM_SEED.
Referenced by CHybridMethodLSODA(), 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 290 of file CHybridMethodLSODA.cpp.
References C_INT, CHybridMethodLSODA::Data::dim, getDefaultAtol(), CModel::getMetabolitesX(), CCopasiProblem::getModel(), CModel::getNumDependentReactionMetabs(), CModel::getNumIndependentReactionMetabs(), CModel::getReactions(), CModel::getStoi(), CCopasiParameter::getValue(), CRandom::initialize(), mAmu, mAmuOld, mAtol, mData, mDefaultAtol, mDWork, mIWork, mLowerStochLimit, mMaxSteps, mMaxStepsReached, mNumVariableMetabs, mPartitioningInterval, mpMetabolites, mpModel, CTrajectoryMethod::mpProblem, mpRandomGenerator, mpReactions, mRandomSeed, mRtol, mStepsAfterPartitionSystem, mStepsize, mStoi, mUpdateSet, mUpperStochLimit, mUseRandomSeed, mYdot, CCopasiParameter::Value::pBOOL, CCopasiParameter::Value::pDOUBLE, CCopasiParameter::Value::pUDOUBLE, CCopasiParameter::Value::pUINT, CVector< CType >::resize(), setupBalances(), setupDependencyGraph(), setupMetab2React(), setupPartition(), setupPriorityQueue(), CCopasiParameterGroup::setValue(), 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 1242 of file CHybridMethodLSODA.cpp.
References mAmu, mAmuOld, mFirstReactionFlag, CHybridLSODAStochFlag::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 422 of file CHybridMethodLSODA.cpp.
References CVectorCore< CType >::array(), CState::beginIndependent(), C_FLOAT64, C_INT, CHybridMethodLSODA::Data::dim, EvalF(), CCopasiMessage::EXCEPTION, CDependencyGraph::getDependents(), CCopasiProblem::getModel(), CModel::getState(), CState::getTime(), mAtol, max, MCTrajectoryMethod, mData, mDG, mDWork, mErrorMsg, mFirstReactionFlag, CHybridLSODAStochFlag::mIndex, mIWork, mJType, mLSODA, mLsodaStatus, mpModel, CHybridLSODAStochFlag::mpNext, CTrajectoryMethod::mpProblem, mpState, mRestartLSODA, mRtol, mState, mTime, mUpdateSet, mY, CInternalSolver::setOstream(), CModel::setState(), CState::setTime(), CModel::setTime(), CVectorCore< CType >::size(), and CModel::updateSimulatedValues().
Referenced by CHybridNextReactionLSODAMethod::doSingleStep().
|
virtual |
Check if the method is suitable for this problem
Reimplemented from CTrajectoryMethod.
Definition at line 1674 of file CHybridMethodLSODA.cpp.
References CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, CModel::getCompartments(), CTrajectoryProblem::getDuration(), CModel::getEvents(), CModel::getMetabolites(), CCopasiProblem::getModel(), CModel::getModelValues(), CModel::getNumMetabs(), CModel::getNumModelValues(), CCopasiParameter::getValue(), CTrajectoryMethod::isValidProblem(), MCTrajectoryMethod, mLowerStochLimit, mUpperStochLimit, CModelEntity::ODE, CCopasiParameter::Value::pDOUBLE, 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 1750 of file CHybridMethodLSODA.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 1384 of file CHybridMethodLSODA.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 1429 of file CHybridMethodLSODA.cpp.
References CCopasiObject::getObjectName(), CState::getTime(), 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 1175 of file CHybridMethodLSODA.cpp.
References C_FLOAT64, calculateAmu(), generateReactionTime(), CCopasiProblem::getModel(), CModel::getTime(), CCopasiParameter::getValue(), HIGH, insertDeterministicReaction(), CIndexedPriorityQueue::insertStochReaction(), LOW, mAmu, mAmuOld, mLowerStochLimit, mMetab2React, mMetabFlags, mNumVariableMetabs, mpMetabolites, CTrajectoryMethod::mpProblem, mPQ, mReactionFlags, mRestartLSODA, mUpperStochLimit, CCopasiParameter::mValue, removeDeterministicReaction(), and CIndexedPriorityQueue::removeStochReaction().
Referenced by CHybridNextReactionLSODAMethod::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 1277 of file CHybridMethodLSODA.cpp.
References mFirstReactionFlag, CHybridLSODAStochFlag::mpPrev, and mReactionFlags.
Referenced by partitionSystem().
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 |
|
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 858 of file CHybridMethodLSODA.cpp.
References C_INT32, CModelEntity::FIXED, CCopasiVector< T >::getIndex(), CModel::getMetabolitesX(), CModelEntity::getStatus(), CHybridLSODABalance::mIndex, mLocalBalances, mLocalSubstrates, mMaxBalance, mMaxIntBeforeStep, mMaxSteps, CHybridLSODABalance::mMultiplicity, CHybridLSODABalance::mpMetabolite, mpModel, mpReactions, and CCopasiVector< T >::size().
Referenced by initMethod().
|
protected |
Sets up the dependency graph
Sets up the dependency graph.
Definition at line 913 of file CHybridMethodLSODA.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 977 of file CHybridMethodLSODA.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 1043 of file CHybridMethodLSODA.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 1006 of file CHybridMethodLSODA.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 1068 of file CHybridMethodLSODA.cpp.
References C_FLOAT64, CCopasiParameter::getValue(), HIGH, LOW, mFirstReactionFlag, mLocalBalances, mLowerStochLimit, mMetabFlags, mNumVariableMetabs, mpMetabolites, CHybridLSODAStochFlag::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 1148 of file CHybridMethodLSODA.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 253 of file CHybridMethodLSODA.cpp.
References CModel::deterministic, CCopasiProblem::getModel(), CModel::getState(), CModel::getTime(), initMethod(), mDoCorrection, mFirstMetabIndex, mHasAssignments, modelHasAssignments(), mpModel, CTrajectoryMethod::mpProblem, mpState, mRestartLSODA, and CModel::setState().
|
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 202 of file CHybridMethodLSODA.cpp.
References CState::beginIndependent(), C_FLOAT64, doSingleStep(), CModel::getMetabolitesX(), CCopasiProblem::getModel(), CModel::getNumVariableMetabs(), CModel::getState(), CModel::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 641 of file CHybridMethodLSODA.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 CHybridNextReactionLSODAMethod::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 787 of file CHybridMethodLSODA.cpp.
References C_FLOAT64, generateReactionTime(), CIndexedPriorityQueue::getKey(), mAmu, mAmuOld, mPQ, and CIndexedPriorityQueue::updateNode().
Referenced by updatePriorityQueue().
|
friend |
|
protected |
Definition at line 545 of file CHybridMethodLSODA.h.
|
protected |
The propensities of the stochastic reactions.
Definition at line 603 of file CHybridMethodLSODA.h.
Referenced by calculateAmu(), generateReactionTime(), initMethod(), insertDeterministicReaction(), outputDebug(), partitionSystem(), updatePriorityQueue(), and updateTauMu().
|
protected |
Definition at line 604 of file CHybridMethodLSODA.h.
Referenced by initMethod(), insertDeterministicReaction(), outputDebug(), partitionSystem(), updatePriorityQueue(), and updateTauMu().
|
protected |
Absolute tolerance.
Definition at line 693 of file CHybridMethodLSODA.h.
Referenced by initMethod(), and integrateDeterministicPart().
|
protected |
mData.dim is the dimension of the ODE system. mData.pMethod contains CLsodaMethod * this to be used in the static method EvalF
Definition at line 648 of file CHybridMethodLSODA.h.
Referenced by CHybridMethodLSODA(), initMethod(), and integrateDeterministicPart().
|
protected |
Definition at line 688 of file CHybridMethodLSODA.h.
Referenced by initMethod().
|
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 620 of file CHybridMethodLSODA.h.
Referenced by fireReaction(), integrateDeterministicPart(), outputDebug(), and setupDependencyGraph().
|
protected |
indicates if the correction N^2 -> N*(N-1) should be performed
Definition at line 524 of file CHybridMethodLSODA.h.
Referenced by calculateAmu(), and start().
Definition at line 702 of file CHybridMethodLSODA.h.
Referenced by initMethod(), and integrateDeterministicPart().
|
protected |
Requested end time.
Definition at line 668 of file CHybridMethodLSODA.h.
|
protected |
Definition at line 698 of file CHybridMethodLSODA.h.
Referenced by integrateDeterministicPart().
|
protected |
index of the first metab in CState
Definition at line 491 of file CHybridMethodLSODA.h.
|
protected |
Definition at line 553 of file CHybridMethodLSODA.h.
Referenced by calculateDerivative(), CHybridNextReactionLSODAMethod::doSingleStep(), insertDeterministicReaction(), integrateDeterministicPart(), 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 727 of file CHybridMethodLSODA.h.
Referenced by start(), and updatePriorityQueue().
Definition at line 703 of file CHybridMethodLSODA.h.
Referenced by initMethod(), and integrateDeterministicPart().
|
protected |
Definition at line 704 of file CHybridMethodLSODA.h.
Referenced by integrateDeterministicPart().
|
protected |
Internal representation of the balances of each reaction. The index of each metabolite in the reaction is provided.
Definition at line 565 of file CHybridMethodLSODA.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 571 of file CHybridMethodLSODA.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 577 of file CHybridMethodLSODA.h.
Referenced by initMethod(), isValidProblem(), outputDebug(), partitionSystem(), and setupPartition().
|
protected |
Definition at line 700 of file CHybridMethodLSODA.h.
Referenced by integrateDeterministicPart().
|
protected |
LSODA state.
Definition at line 673 of file CHybridMethodLSODA.h.
Referenced by integrateDeterministicPart().
|
protected |
maximal increase of a particle number in one step.
Definition at line 514 of file CHybridMethodLSODA.h.
Referenced by outputDebug(), and setupBalances().
|
protected |
This is set to maxint - mMaxSteps*mMaxBalance
Definition at line 519 of file CHybridMethodLSODA.h.
Referenced by outputDebug(), setupBalances(), and step().
|
protected |
Max number of doSingleStep() per step()
Definition at line 496 of file CHybridMethodLSODA.h.
Referenced by initMethod(), outputDebug(), setupBalances(), and step().
|
protected |
Definition at line 498 of file CHybridMethodLSODA.h.
Referenced by initMethod(), and step().
|
protected |
Vector of relations between metabolites to reactions.
Definition at line 598 of file CHybridMethodLSODA.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 559 of file CHybridMethodLSODA.h.
Referenced by outputDebug(), partitionSystem(), and setupPartition().
|
protected |
Dimension of the system. Total number of metabolites.
Definition at line 486 of file CHybridMethodLSODA.h.
Referenced by evalF(), initMethod(), outputDebug(), partitionSystem(), and setupPartition().
|
protected |
|
protected |
File output stream to write data.
Definition at line 710 of file CHybridMethodLSODA.h.
|
protected |
Output filename.
Definition at line 715 of file CHybridMethodLSODA.h.
|
protected |
The system gets repartitioned after this number of elementary steps.
Definition at line 583 of file CHybridMethodLSODA.h.
Referenced by CHybridNextReactionLSODAMethod::doSingleStep(), initMethod(), and outputDebug().
|
protected |
A pointer to the metabolites of the model.
Definition at line 534 of file CHybridMethodLSODA.h.
Referenced by initMethod(), outputData(), outputDebug(), partitionSystem(), setupMetab2React(), setupMetab2ReactComplete(), setupMetab2ReactPlusModifier(), and setupPartition().
|
protected |
Pointer to the model
Definition at line 481 of file CHybridMethodLSODA.h.
Referenced by cleanup(), initMethod(), integrateDeterministicPart(), 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 629 of file CHybridMethodLSODA.h.
Referenced by CHybridNextReactionLSODAMethod::doSingleStep(), getStochTimeAndIndex(), outputDebug(), partitionSystem(), setupPriorityQueue(), updatePriorityQueue(), and updateTauMu().
|
protected |
The random number generator.
Definition at line 614 of file CHybridMethodLSODA.h.
Referenced by CHybridMethodLSODA(), cleanup(), generateReactionTime(), initMethod(), and outputDebug().
|
protected |
A pointer to the reactions of the model.
Definition at line 529 of file CHybridMethodLSODA.h.
Referenced by checkModel(), getDependsOn(), initMethod(), outputDebug(), setupBalances(), setupDependencyGraph(), setupMetab2ReactComplete(), setupMetab2ReactPlusModifier(), setupPriorityQueue(), and updatePriorityQueue().
|
protected |
A pointer to the current state in complete model view.
Definition at line 642 of file CHybridMethodLSODA.h.
Referenced by evalF(), integrateDeterministicPart(), and start().
|
protected |
The random seed to use.
Definition at line 509 of file CHybridMethodLSODA.h.
Referenced by initMethod().
|
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 552 of file CHybridMethodLSODA.h.
Referenced by insertDeterministicReaction(), outputDebug(), partitionSystem(), removeDeterministicReaction(), setupPartition(), setupPriorityQueue(), and updatePriorityQueue().
|
protected |
Definition at line 678 of file CHybridMethodLSODA.h.
|
protected |
this flag indicates whether the next LSODA call needs to reinitialize the integrater (if the partitioning has changed or a stochastic reaction was fired)
Definition at line 637 of file CHybridMethodLSODA.h.
Referenced by fireReaction(), integrateDeterministicPart(), partitionSystem(), and start().
|
protected |
Relative tolerance.
Definition at line 683 of file CHybridMethodLSODA.h.
Referenced by initMethod(), and integrateDeterministicPart().
|
protected |
Definition at line 701 of file CHybridMethodLSODA.h.
Referenced by integrateDeterministicPart().
|
protected |
Number of elementary steps after the last partitioning.
Definition at line 588 of file CHybridMethodLSODA.h.
Referenced by CHybridNextReactionLSODAMethod::doSingleStep(), initMethod(), and outputDebug().
|
protected |
Partitioning stepsize
Definition at line 593 of file CHybridMethodLSODA.h.
Referenced by CHybridNextReactionLSODAMethod::doSingleStep(), initMethod(), and outputDebug().
The stoichometry matrix of the model.
Definition at line 539 of file CHybridMethodLSODA.h.
Referenced by calculateDerivative(), checkModel(), initMethod(), and outputDebug().
|
protected |
Current time.
Definition at line 663 of file CHybridMethodLSODA.h.
Referenced by integrateDeterministicPart().
|
protected |
Set of the reactions, which must be updated.
Definition at line 609 of file CHybridMethodLSODA.h.
Referenced by fireReaction(), initMethod(), integrateDeterministicPart(), outputDebug(), and updatePriorityQueue().
|
protected |
Definition at line 578 of file CHybridMethodLSODA.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 504 of file CHybridMethodLSODA.h.
Referenced by initMethod().
|
protected |
Pointer to the array with left hand side values.
Definition at line 653 of file CHybridMethodLSODA.h.
Referenced by integrateDeterministicPart().
Vector containig the derivatives after calling eval
Definition at line 658 of file CHybridMethodLSODA.h.
Referenced by initMethod().
|
protected |
Vectors to hold the system state and intermediate results
Definition at line 544 of file CHybridMethodLSODA.h.
Referenced by evalF(), initMethod(), and outputDebug().