COPASI API
4.16.103
|
#include <CMathEvent.h>
Classes | |
class | CAssignment |
Public Member Functions | |
void | applyDelayRefreshes () |
CMathEvent (const CCopasiContainer *pParent=NULL) | |
CMathEvent (const CMathEvent &src, const CCopasiContainer *pParent=NULL) | |
bool | compile (const CEvent *pEvent, std::vector< CCopasiContainer * > listOfContainer) |
const bool & | delayAssignment () const |
bool | executeAssignment () |
void | fire (const C_FLOAT64 &time, const bool &equality, CProcessQueue &processQueue) |
C_FLOAT64 | getAssignmentTime (const C_FLOAT64 ¤tTime) |
C_FLOAT64 | getCalculationTime (const C_FLOAT64 ¤tTime) |
CMathTrigger & | getMathTrigger () |
const size_t & | getOrder () const |
CVector< C_FLOAT64 > | getTargetValues () |
const CEvent::Type & | getType () const |
bool | setTargetValues (const CVector< C_FLOAT64 > &targetValues) |
~CMathEvent () | |
![]() | |
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 CObjectInterface * | getObject (const CCopasiObjectName &cn) 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 CCopasiObjectName | getCN () const |
virtual const DataObjectSet & | getDirectDependencies (const DataObjectSet &context=DataObjectSet()) const |
virtual const std::string & | getKey () const |
CCopasiContainer * | getObjectAncestor (const std::string &type) const |
CCopasiDataModel * | getObjectDataModel () |
const CCopasiDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName (bool regular=true, bool richtext=false) 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 |
virtual void * | getValuePointer () 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 |
virtual void | print (std::ostream *ostream) 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 () |
Private Member Functions | |
void | applyDependentRefreshes () |
void | applyValueRefreshes () |
C_FLOAT64 | calculateDelayedTime (const C_FLOAT64 ¤tTime) |
Private Attributes | |
CCopasiVector< CAssignment > | mAssignments |
std::vector< Refresh * > | mAssignmentValueRefreshes |
CExpression | mDelay |
bool | mDelayAssignment |
std::vector< Refresh * > | mDelayValueRefreshes |
std::vector< Refresh * > | mDependentValueRefreshes |
bool | mHaveDelay |
size_t | mOrder |
CMathTrigger | mTrigger |
CEvent::Type | mType |
Additional Inherited Members | |
![]() | |
typedef std::multimap < std::string, CCopasiObject * > | objectMap |
![]() | |
typedef std::set< const CCopasiObject * > | DataObjectSet |
typedef std::vector< Refresh * > | DataUpdateSequence |
![]() | |
typedef std::set< const CObjectInterface * > | ObjectSet |
typedef std::vector < CObjectInterface * > | UpdateSequence |
![]() | |
static std::vector< Refresh * > | buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet()) |
static void | setRenameHandler (CRenameHandler *rh) |
![]() | |
static const std::vector < CCopasiContainer * > | EmptyList |
![]() | |
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 } |
![]() | |
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) | |
![]() | |
objectMap | mObjects |
![]() | |
static CRenameHandler * | smpRenameHandler = NULL |
Definition at line 279 of file CMathEvent.h.
CMathEvent::CMathEvent | ( | const CCopasiContainer * | pParent = NULL | ) |
Default constructor
const | CCopasiContainer * pParent (default: NULL) |
Definition at line 1048 of file CMathEvent.cpp.
CMathEvent::CMathEvent | ( | const CMathEvent & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor
const CMathEvent & | src |
"const | CCopasiContainer * pParent (default: NULL) |
Definition at line 1062 of file CMathEvent.cpp.
CMathEvent::~CMathEvent | ( | ) |
void CMathEvent::applyDelayRefreshes | ( | ) |
Apply all needed refreshes so that the delay expression are correctly calculated.
Definition at line 1198 of file CMathEvent.cpp.
References mDelayValueRefreshes.
Referenced by calculateDelayedTime().
|
private |
Apply all needed refreshes to update all values depending on the assignment targets.
Definition at line 1220 of file CMathEvent.cpp.
References mDependentValueRefreshes.
Referenced by setTargetValues().
|
private |
Apply all needed refreshes so that the assignment expressions are correctly calculated.
Definition at line 1209 of file CMathEvent.cpp.
References mAssignmentValueRefreshes.
Referenced by getTargetValues().
Calculate the time for delays. This accounts for small errors relative to the current time.
const | C_FLOAT64 & currentTime |
Definition at line 1266 of file CMathEvent.cpp.
References applyDelayRefreshes(), C_FLOAT64, CExpression::calcValue(), CCopasiMessage::EXCEPTION, CEvaluationTree::getInfix(), MCMathModel, mDelay, and min.
Referenced by getAssignmentTime(), and getCalculationTime().
bool CMathEvent::compile | ( | const CEvent * | pEvent, |
std::vector< CCopasiContainer * > | listOfContainer | ||
) |
Compile the root finder
const | CEvent * pEvent |
std::vector< | CCopasiContainer * > listOfContainer |
Definition at line 1080 of file CMathEvent.cpp.
References CCopasiVector< T >::begin(), CMathModel::buildDependendRefreshList(), CMathModel::buildRequiredRefreshList(), CExpression::compile(), CMathTrigger::compile(), CMathEvent::CAssignment::compile(), CCopasiVector< T >::end(), CEvent::getAssignments(), CEvent::getDelayAssignment(), CEvent::getDelayExpression(), CCopasiObject::getDirectDependencies(), CEvaluationTree::getInfix(), CCopasiObject::getObjectAncestor(), CEvent::getTriggerExpressionPtr(), CEvent::getType(), mAssignments, mAssignmentValueRefreshes, mDelay, mDelayAssignment, mDelayValueRefreshes, mDependentValueRefreshes, mHaveDelay, mTrigger, mType, and CExpression::setInfix().
Referenced by CMathModel::compile().
const bool & CMathEvent::delayAssignment | ( | ) | const |
Check whether to delay the assignment
Definition at line 1241 of file CMathEvent.cpp.
References mDelayAssignment.
bool CMathEvent::executeAssignment | ( | ) |
Calculate and assign the new target values
Definition at line 1193 of file CMathEvent.cpp.
References getTargetValues(), and setTargetValues().
void CMathEvent::fire | ( | const C_FLOAT64 & | time, |
const bool & | equality, | ||
CProcessQueue & | processQueue | ||
) |
The event fires and the appropriate actions are scheduled in the process queue.
const | C_FLOAT64 & time |
const | bool & equality |
CProcessQueue | & processQueue |
Definition at line 1137 of file CMathEvent.cpp.
References CProcessQueue::addAssignment(), CProcessQueue::addCalculation(), getAssignmentTime(), getCalculationTime(), getTargetValues(), and mDelayAssignment.
Referenced by CMathModel::processRoots().
Retrieve the time for executing the assignmentS
const | C_FLOAT64 & currentTime |
Definition at line 1256 of file CMathEvent.cpp.
References calculateDelayedTime(), and mDelayAssignment.
Referenced by fire().
Retrieve the time for calculating the assignment expression
const | C_FLOAT64 & currentTime |
Definition at line 1246 of file CMathEvent.cpp.
References calculateDelayedTime(), and mDelayAssignment.
Referenced by fire().
CMathTrigger & CMathEvent::getMathTrigger | ( | ) |
Retrieve the trigger for this event.
Definition at line 1231 of file CMathEvent.cpp.
References mTrigger.
Referenced by CMathModel::compile(), and CMathModel::processRoots().
const size_t & CMathEvent::getOrder | ( | ) | const |
Retrieve the order in which this event shall be processed
Definition at line 1236 of file CMathEvent.cpp.
References mOrder.
Calculate and retrieve the new target values
Definition at line 1151 of file CMathEvent.cpp.
References applyValueRefreshes(), C_FLOAT64, and mAssignments.
Referenced by executeAssignment(), and fire().
const CEvent::Type & CMathEvent::getType | ( | ) | const |
Retrieve the type of the event
Definition at line 1307 of file CMathEvent.cpp.
References mType.
Referenced by CProcessQueue::CAction::CAction().
Set the target values
const | CVector< C_FLOAT64 > & targetValues |
Definition at line 1168 of file CMathEvent.cpp.
References applyDependentRefreshes(), CVectorCore< CType >::array(), C_FLOAT64, and mAssignments.
Referenced by executeAssignment().
|
private |
List of assignments
Definition at line 483 of file CMathEvent.h.
Referenced by compile(), getTargetValues(), and setTargetValues().
|
private |
A sequence of refresh calls needed to prepare to calculate the current values of the assignments.
Definition at line 495 of file CMathEvent.h.
Referenced by applyValueRefreshes(), and compile().
|
private |
Delay expression.
Definition at line 473 of file CMathEvent.h.
Referenced by calculateDelayedTime(), and compile().
|
private |
Boolean value indicating whether the calculation or the assignment is delayed.
Definition at line 478 of file CMathEvent.h.
Referenced by compile(), delayAssignment(), fire(), getAssignmentTime(), and getCalculationTime().
|
private |
A sequence of refresh calls needed to prepare to calculate the delay value.
Definition at line 489 of file CMathEvent.h.
Referenced by applyDelayRefreshes(), and compile().
|
private |
A sequence of refresh calls needed to calculate all values which depend on the target values of the assignments.
Definition at line 501 of file CMathEvent.h.
Referenced by applyDependentRefreshes(), and compile().
|
private |
Boolean value indicating whether the event involves a delay.
Definition at line 468 of file CMathEvent.h.
Referenced by compile().
|
private |
The order in which the event is processed in case of simultaneous assignments
Definition at line 463 of file CMathEvent.h.
Referenced by getOrder().
|
private |
Trigger expression.
Definition at line 457 of file CMathEvent.h.
Referenced by compile(), and getMathTrigger().
|
private |
The type of the event
Definition at line 506 of file CMathEvent.h.