COPASI API  4.40.278
CMathEvent Class Reference

#include <CMathEvent.h>

Classes

class  CAssignment
 
class  CTrigger
 

Public Member Functions

void addAssignment (CMathObject *pTarget, CMathObject *pExpression)
 
void addPendingAction (const CMathEventQueue::iterator &pendingAction)
 
 CMathEvent ()
 
 CMathEvent (const CMathEvent &src)
 
bool compile (CMathContainer &container)
 
bool compile (const CEvent *pDataEvent, CMathContainer &container)
 
void copy (const CMathEvent &src, CMathContainer &container)
 
void createUpdateSequences ()
 
const bool & delayAssignment () const
 
CMath::StateChange executeAssignment ()
 
void executeCallback (void *pCaller=NULL)
 
void fire (const bool &equality)
 
const bool & fireAtInitialTime () const
 
const CVector< CAssignment > & getAssignments () const
 
C_FLOAT64 getCalculationTime () const
 
C_FLOAT64 getExecutionTime () const
 
const CMathObjectgetPriority () const
 
const CVectorCore< C_FLOAT64 > & getTargetValues ()
 
const CTriggergetTrigger () const
 
const CEvent::TypegetType () const
 
void initialize (CMath::sPointers &pointers)
 
const bool & isDisabled () const
 
CMathEventoperator= (const CMathEvent &rhs)
 
void relocate (const CMathContainer *pContainer, const std::vector< CMath::sRelocate > &relocations)
 
void removePendingAction ()
 
void setCallback (CCallbackInterface *pCallback)
 
void setDelayExpression (const std::string &infix, CMathContainer &container)
 
void setDisabled (const bool &disabled)
 
void setPriorityExpression (const std::string &infix, CMathContainer &container)
 
CMath::StateChange setTargetValues (const CVectorCore< C_FLOAT64 > &targetValues)
 
void setTriggerExpression (const std::string &infix, CMathContainer &container)
 
 ~CMathEvent ()
 

Static Public Member Functions

static void allocate (CMathEvent &Event, const CEvent *pDataEvent, const CMathContainer &container)
 

Private Attributes

CVector< CAssignmentmAssignments
 
bool mDelayExecution
 
CCore::CUpdateSequence mDelaySequence
 
bool mDisabled
 
CMath::StateChange mEffectsSimulation
 
bool mFireAtInitialTime
 
CCallbackInterfacempCallback
 
CMathContainermpContainer
 
CMathObjectmpDelay
 
CCore::CUpdateSequence mPostAssignmentSequence
 
std::pair< CMathEventQueue::CKey, CMathEventQueue::CAction > * mpPendingAction
 
CMathObjectmpPriority
 
const C_FLOAT64mpTime
 
CVector< C_FLOAT64 * > mTargetPointers
 
CVectorCore< C_FLOAT64mTargetValues
 
CCore::CUpdateSequence mTargetValuesSequence
 
CTrigger mTrigger
 
bool mTriggerIsPersistent
 
CEvent::Type mType
 

Friends

std::ostream & operator<< (std::ostream &os, const CMathEvent &o)
 

Constructor & Destructor Documentation

◆ CMathEvent() [1/2]

CMathEvent::CMathEvent ( )

Default constructor

◆ CMathEvent() [2/2]

CMathEvent::CMathEvent ( const CMathEvent src)

Default constructor

◆ ~CMathEvent()

CMathEvent::~CMathEvent ( )

Destructor

References mpPendingAction, and pdelete.

Member Function Documentation

◆ addAssignment()

void CMathEvent::addAssignment ( CMathObject pTarget,
CMathObject pExpression 
)

◆ addPendingAction()

void CMathEvent::addPendingAction ( const CMathEventQueue::iterator pendingAction)

Add a pending action to the event;

Parameters
constCMathEventQueue::iterator & pendingAction

References mpPendingAction, and mTriggerIsPersistent.

Referenced by CMathEventQueue::addAssignment(), and CMathEventQueue::addCalculation().

◆ allocate()

◆ compile() [1/2]

◆ compile() [2/2]

◆ copy()

void CMathEvent::copy ( const CMathEvent src,
CMathContainer container 
)

Copy an existing object

Parameters
constCMathEvent & src
CMathContainer& container

References CMathEvent::CAssignment::copy(), CMathEvent::CTrigger::copy(), mAssignments, and mTrigger.

◆ createUpdateSequences()

◆ delayAssignment()

const bool & CMathEvent::delayAssignment ( ) const

Check whether to delay the assignment

Returns
const bool & delayAssignment

References mDelayExecution.

◆ executeAssignment()

CMath::StateChange CMathEvent::executeAssignment ( )

Calculate and assign the new target values

Returns
CMath::StateChange stateChanged

References getTargetValues(), and setTargetValues().

◆ executeCallback()

void CMathEvent::executeCallback ( void *  pCaller = NULL)

Execute the callback

Parameters
void* pCaller (default: NULL)

References mpCallback.

◆ fire()

◆ fireAtInitialTime()

const bool & CMathEvent::fireAtInitialTime ( ) const

Check whether the event may fire at initial time.

Returns
const bool & fireAtInitialTime

References mFireAtInitialTime.

Referenced by CMathContainer::applyInitialValues().

◆ getAssignments()

◆ getCalculationTime()

C_FLOAT64 CMathEvent::getCalculationTime ( ) const

Retrieve the time for calculating the assignment expression

Returns
C_FLOAT64 calculationTime

References CMathContainer::applyUpdateSequence(), C_FLOAT64, CMathObject::getValuePointer(), mDelayExecution, mDelaySequence, mpContainer, mpDelay, and mpTime.

Referenced by fire().

◆ getExecutionTime()

C_FLOAT64 CMathEvent::getExecutionTime ( ) const

Retrieve the time for executing the assignmentS

Returns
C_FLOAT64 executionTime

References CMathContainer::applyUpdateSequence(), C_FLOAT64, CMathObject::getValuePointer(), mDelayExecution, mDelaySequence, mpContainer, mpDelay, and mpTime.

Referenced by fire().

◆ getPriority()

const CMathObject * CMathEvent::getPriority ( ) const

◆ getTargetValues()

const CVectorCore< C_FLOAT64 > & CMathEvent::getTargetValues ( )

Calculate and retrieve the new target values

Returns
const CVectorCore< C_FLOAT64 > & targetValues

References CMathContainer::applyUpdateSequence(), mpContainer, mTargetValues, and mTargetValuesSequence.

Referenced by executeAssignment(), and fire().

◆ getTrigger()

◆ getType()

const CEvent::Type & CMathEvent::getType ( ) const

Retrieve the type of the event

Returns
const CEvent::Type & type

References mType.

Referenced by CMathEventQueue::CAction::CAction().

◆ initialize()

◆ isDisabled()

const bool & CMathEvent::isDisabled ( ) const

Check whether an even is disabled.

Returns
const bool & isDisabled

References mDisabled.

Referenced by CMathContainer::analyzeRoots().

◆ operator=()

◆ relocate()

void CMathEvent::relocate ( const CMathContainer pContainer,
const std::vector< CMath::sRelocate > &  relocations 
)

◆ removePendingAction()

void CMathEvent::removePendingAction ( )

Remove the pending action to the event;

References mpPendingAction, and pdelete.

Referenced by CMathContainer::applyInitialValues().

◆ setCallback()

void CMathEvent::setCallback ( CCallbackInterface pCallback)

Set the callback to be executed for events of type Callback

Parameters
CCallbackInterface* pCallback

References mpCallback.

Referenced by CAnalyticsTask::setEventCallback(), and CCrossSectionTask::setEventCallback().

◆ setDelayExpression()

void CMathEvent::setDelayExpression ( const std::string &  infix,
CMathContainer container 
)

Set the delay expression

Parameters
conststd::string & infix
CMathContainer& container

References mpDelay, and CMathObject::setExpression().

◆ setDisabled()

void CMathEvent::setDisabled ( const bool &  disabled)

Set whether the event is disabled.

Parameters
constbool & disabled

References mDisabled.

Referenced by CMathContainer::ignoreDiscontinuityEvent().

◆ setPriorityExpression()

void CMathEvent::setPriorityExpression ( const std::string &  infix,
CMathContainer container 
)

Set the priority expression

Parameters
conststd::string & infix
CMathContainer& container

References mpPriority, and CMathObject::setExpression().

◆ setTargetValues()

◆ setTriggerExpression()

void CMathEvent::setTriggerExpression ( const std::string &  infix,
CMathContainer container 
)

Set the trigger expression

Parameters
conststd::string & infix
CMathContainer& container

References mTrigger, and CMathEvent::CTrigger::setExpression().

Referenced by CMathContainer::replaceDiscontinuousNode().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CMathEvent o 
)
friend

Member Data Documentation

◆ mAssignments

◆ mDelayExecution

bool CMathEvent::mDelayExecution
private

A Boolean flag indicating whether to delay assignment phase or calculation phase.

Referenced by compile(), delayAssignment(), fire(), getCalculationTime(), getExecutionTime(), and operator=().

◆ mDelaySequence

CCore::CUpdateSequence CMathEvent::mDelaySequence
private

The update sequence executed prior to creating calculation actions.

Referenced by createUpdateSequences(), getCalculationTime(), getExecutionTime(), and operator=().

◆ mDisabled

bool CMathEvent::mDisabled
private

A Boolean flag indicating whether the even is disabled, i.e., will not fire

Referenced by compile(), fire(), isDisabled(), operator=(), and setDisabled().

◆ mEffectsSimulation

CMath::StateChange CMathEvent::mEffectsSimulation
private

Flag indicating whether the event effects the discrete and/or the continuous state values.

Referenced by createUpdateSequences(), operator=(), and setTargetValues().

◆ mFireAtInitialTime

bool CMathEvent::mFireAtInitialTime
private

A Boolean flag indicating whether the event may fire at the initial time.

Referenced by compile(), fireAtInitialTime(), and operator=().

◆ mpCallback

CCallbackInterface* CMathEvent::mpCallback
private

A pointer to an optional callback

Referenced by executeCallback(), operator=(), and setCallback().

◆ mpContainer

CMathContainer* CMathEvent::mpContainer
private

A pointer to the math container the event queue belongs to.

Referenced by compile(), createUpdateSequences(), fire(), getCalculationTime(), getExecutionTime(), getTargetValues(), operator=(), relocate(), and setTargetValues().

◆ mpDelay

CMathObject* CMathEvent::mpDelay
private

◆ mPostAssignmentSequence

CCore::CUpdateSequence CMathEvent::mPostAssignmentSequence
private

The update sequence executed after the new values are assigned to update the state.

Referenced by createUpdateSequences(), operator=(), and setTargetValues().

◆ mpPendingAction

std::pair< CMathEventQueue::CKey, CMathEventQueue::CAction >* CMathEvent::mpPendingAction
private

A pointer to the currently pending actions for used for persistent triggers

Referenced by addPendingAction(), fire(), operator=(), removePendingAction(), and ~CMathEvent().

◆ mpPriority

CMathObject* CMathEvent::mpPriority
private

A pointer to the priority object.

Referenced by compile(), getPriority(), initialize(), operator=(), relocate(), and setPriorityExpression().

◆ mpTime

const C_FLOAT64* CMathEvent::mpTime
private

A pointer to the current container time

Referenced by compile(), getCalculationTime(), getExecutionTime(), operator=(), and relocate().

◆ mTargetPointers

CVector< C_FLOAT64 * > CMathEvent::mTargetPointers
private

Vector of pointers to targets

Referenced by compile(), operator=(), relocate(), and setTargetValues().

◆ mTargetValues

CVectorCore< C_FLOAT64 > CMathEvent::mTargetValues
private

Vector reference of target Values

Referenced by compile(), getTargetValues(), operator=(), and relocate().

◆ mTargetValuesSequence

CCore::CUpdateSequence CMathEvent::mTargetValuesSequence
private

The update sequence executed prior to creating assignment actions.

Referenced by createUpdateSequences(), getTargetValues(), and operator=().

◆ mTrigger

CTrigger CMathEvent::mTrigger
private

◆ mTriggerIsPersistent

bool CMathEvent::mTriggerIsPersistent
private

A Boolean flag indicating whether the trigger expression must remain true between trigger phase and assignment phase (mTriggerIsPersistent = false).

Referenced by addPendingAction(), compile(), fire(), and operator=().

◆ mType

CEvent::Type CMathEvent::mType
private

The type of the event.

Referenced by compile(), createUpdateSequences(), fire(), getType(), operator=(), and setTargetValues().


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