COPASI API
4.40.278
|
#include <CMathEvent.h>
Classes | |
class | CAssignment |
class | CTrigger |
Static Public Member Functions | |
static void | allocate (CMathEvent &Event, const CEvent *pDataEvent, const CMathContainer &container) |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CMathEvent &o) |
CMathEvent::CMathEvent | ( | ) |
Default constructor
CMathEvent::CMathEvent | ( | const CMathEvent & | src | ) |
Default constructor
CMathEvent::~CMathEvent | ( | ) |
Destructor
References mpPendingAction, and pdelete.
void CMathEvent::addAssignment | ( | CMathObject * | pTarget, |
CMathObject * | pExpression | ||
) |
Add an assignment
CMathObject | * pTarget |
CMathObject | * pExpression |
References mAssignments, CMathEvent::CAssignment::setAssignment(), and CMathEvent::CAssignment::setTarget().
Referenced by CMathContainer::replaceDiscontinuousNode().
void CMathEvent::addPendingAction | ( | const CMathEventQueue::iterator & | pendingAction | ) |
Add a pending action to the event;
const | CMathEventQueue::iterator & pendingAction |
References mpPendingAction, and mTriggerIsPersistent.
Referenced by CMathEventQueue::addAssignment(), and CMathEventQueue::addCalculation().
|
static |
bool CMathEvent::compile | ( | CMathContainer & | container | ) |
References CVectorCore< CType >::array(), C_FLOAT64, CExpression::compile(), CMathEvent::CTrigger::compile(), CEvent::Discontinuity, CMathEvent::CAssignment::getAssignment(), CMathContainer::getCountFixedEventTargets(), CMathContainer::getState(), CMathEvent::CAssignment::getTarget(), CMathObject::getValuePointer(), CVectorCore< CType >::initialize(), mAssignments, mDelayExecution, mDisabled, mFireAtInitialTime, mpContainer, mpDelay, mpPriority, mpTime, mTargetPointers, mTargetValues, mTrigger, mTriggerIsPersistent, mType, CVector< CType >::resize(), CMathObject::setExpression(), and CExpression::setInfix().
bool CMathEvent::compile | ( | const CEvent * | pDataEvent, |
CMathContainer & | container | ||
) |
References CVectorCore< CType >::array(), CDataVector< CType >::begin(), C_FLOAT64, CExpression::compile(), CMathEvent::CTrigger::compile(), CMathEvent::CAssignment::compile(), CDataVector< CType >::end(), CMathEvent::CAssignment::getAssignment(), CEvent::getAssignments(), CMathContainer::getCountFixedEventTargets(), CEvent::getDelayAssignment(), CEvent::getDelayExpression(), CEvent::getDelayExpressionPtr(), CEvent::getFireAtInitialTime(), CEvent::getPersistentTrigger(), CEvent::getPriorityExpression(), CEvent::getPriorityExpressionPtr(), CMathContainer::getState(), CMathEvent::CAssignment::getTarget(), CEvent::getType(), CMathObject::getValuePointer(), CVectorCore< CType >::initialize(), mAssignments, mDelayExecution, mDisabled, mFireAtInitialTime, mpContainer, mpDelay, mpPriority, mpTime, mTargetPointers, mTargetValues, mTrigger, mTriggerIsPersistent, mType, CVector< CType >::resize(), CMathObject::setDataObject(), CMathObject::setExpression(), and CExpression::setInfix().
Referenced by CMathContainer::addAnalysisEvent(), CMathEvent::CTrigger::compile(), CMathContainer::compileEvents(), CMathEvent::CTrigger::compileFUNCTION(), and CMathEvent::CTrigger::setExpression().
void CMathEvent::copy | ( | const CMathEvent & | src, |
CMathContainer & | container | ||
) |
Copy an existing object
const | CMathEvent & src |
CMathContainer | & container |
References CMathEvent::CAssignment::copy(), CMathEvent::CTrigger::copy(), mAssignments, and mTrigger.
void CMathEvent::createUpdateSequences | ( | ) |
Create the update sequences required for event processing.
References CVectorCore< CType >::array(), CVectorCore< CType >::begin(), CMath::ContinuousSimulation, CMath::Conversion, CCore::Default, CMath::Discontinuity, CEvent::Discontinuity, CMathUpdateSequence::empty(), CMath::EventSimulation, CMath::EventTarget, CModelEntity::FIXED, CMath::FixedEventTarget, CMathEvent::CAssignment::getAssignment(), CMathObject::getDataObject(), CMathContainer::getMathObject(), CDataObject::getObjectParent(), CMathContainer::getRoots(), CMathObject::getSimulationType(), CMathContainer::getSimulationUpToDateObjects(), CMathContainer::getStateObjects(), CModelEntity::getStatus(), CMathEvent::CAssignment::getTarget(), CMathContainer::getTotalMasses(), CMathContainer::getTransientDependencies(), CMathDependencyGraph::getUpdateSequence(), mAssignments, mDelaySequence, mEffectsSimulation, mpContainer, mpDelay, mPostAssignmentSequence, mTargetValuesSequence, mType, CFlags< eStateChange >::None, CMathEvent::CAssignment::setIsStateValue(), CVectorCore< CType >::size(), CMath::State, and CCore::UpdateMoieties.
Referenced by CMathContainer::createUpdateSequences().
const bool & CMathEvent::delayAssignment | ( | ) | const |
Check whether to delay the assignment
References mDelayExecution.
CMath::StateChange CMathEvent::executeAssignment | ( | ) |
Calculate and assign the new target values
References getTargetValues(), and setTargetValues().
void CMathEvent::executeCallback | ( | void * | pCaller = NULL | ) |
void CMathEvent::fire | ( | const bool & | equality | ) |
The event fires and the appropriate actions are scheduled in the process queue.
const | bool & equality |
References CMathEventQueue::addAssignment(), CMathEventQueue::addCalculation(), CEvent::Discontinuity, getCalculationTime(), getExecutionTime(), CMathContainer::getProcessQueue(), getTargetValues(), CMathEvent::CTrigger::isTrue(), mDelayExecution, mDisabled, mpContainer, mpPendingAction, mTrigger, mTriggerIsPersistent, mType, pdelete, and CMathEventQueue::removeAction().
Referenced by CMathContainer::applyInitialValues(), and CMathContainer::processRoots().
const bool & CMathEvent::fireAtInitialTime | ( | ) | const |
Check whether the event may fire at initial time.
References mFireAtInitialTime.
Referenced by CMathContainer::applyInitialValues().
const CVector< CMathEvent::CAssignment > & CMathEvent::getAssignments | ( | ) | const |
References mAssignments.
Referenced by CMathContainer::addAnalysisEvent(), CMathContainer::allocate(), and CMathContainer::removeAnalysisEvent().
C_FLOAT64 CMathEvent::getCalculationTime | ( | ) | const |
Retrieve the time for calculating the assignment expression
References CMathContainer::applyUpdateSequence(), C_FLOAT64, CMathObject::getValuePointer(), mDelayExecution, mDelaySequence, mpContainer, mpDelay, and mpTime.
Referenced by fire().
C_FLOAT64 CMathEvent::getExecutionTime | ( | ) | const |
Retrieve the time for executing the assignmentS
References CMathContainer::applyUpdateSequence(), C_FLOAT64, CMathObject::getValuePointer(), mDelayExecution, mDelaySequence, mpContainer, mpDelay, and mpTime.
Referenced by fire().
const CMathObject * CMathEvent::getPriority | ( | ) | const |
References mpPriority.
Referenced by CMathEventQueue::addAssignment(), CMathEventQueue::addCalculation(), and CMathEventQueue::CAction::CAction().
const CVectorCore< C_FLOAT64 > & CMathEvent::getTargetValues | ( | ) |
Calculate and retrieve the new target values
References CMathContainer::applyUpdateSequence(), mpContainer, mTargetValues, and mTargetValuesSequence.
Referenced by executeAssignment(), and fire().
const CMathEvent::CTrigger & CMathEvent::getTrigger | ( | ) | const |
const CEvent::Type & CMathEvent::getType | ( | ) | const |
Retrieve the type of the event
References mType.
Referenced by CMathEventQueue::CAction::CAction().
void CMathEvent::initialize | ( | CMath::sPointers & | pointers | ) |
References CMath::Event, CMath::EventDelay, CMath::EventPriority, CMathEvent::CAssignment::initialize(), CMathEvent::CTrigger::initialize(), CMathObject::initialize(), mAssignments, mpDelay, mpPriority, mTrigger, CMath::sPointers::pEventDelays, CMath::sPointers::pEventDelaysObject, CMath::sPointers::pEventPriorities, CMath::sPointers::pEventPrioritiesObject, and CMath::Undefined.
Referenced by CMathContainer::addAnalysisEvent(), and CMathContainer::initializeEvents().
const bool & CMathEvent::isDisabled | ( | ) | const |
Check whether an even is disabled.
References mDisabled.
Referenced by CMathContainer::analyzeRoots().
CMathEvent & CMathEvent::operator= | ( | const CMathEvent & | rhs | ) |
References CVectorCore< CType >::initialize(), mAssignments, mDelayExecution, mDelaySequence, mDisabled, mEffectsSimulation, mFireAtInitialTime, mpCallback, mpContainer, mpDelay, mPostAssignmentSequence, mpPendingAction, mpPriority, mpTime, mTargetPointers, mTargetValues, mTargetValuesSequence, mTrigger, mTriggerIsPersistent, and mType.
void CMathEvent::relocate | ( | const CMathContainer * | pContainer, |
const std::vector< CMath::sRelocate > & | relocations | ||
) |
The objects and values are relocated
const | CMathContainer * pContainer |
const | std::vector< CMath::sRelocate > & relocations |
References CVectorCore< CType >::array(), C_FLOAT64, CVectorCore< CType >::initialize(), mAssignments, mpContainer, mpDelay, mpPriority, mpTime, mTargetPointers, mTargetValues, mTrigger, CMathEvent::CAssignment::relocate(), CMathEvent::CTrigger::relocate(), CMathContainer::relocateObject(), CMathContainer::relocateValue(), and CVectorCore< CType >::size().
void CMathEvent::removePendingAction | ( | ) |
Remove the pending action to the event;
References mpPendingAction, and pdelete.
Referenced by CMathContainer::applyInitialValues().
void CMathEvent::setCallback | ( | CCallbackInterface * | pCallback | ) |
Set the callback to be executed for events of type Callback
CCallbackInterface | * pCallback |
References mpCallback.
Referenced by CAnalyticsTask::setEventCallback(), and CCrossSectionTask::setEventCallback().
void CMathEvent::setDelayExpression | ( | const std::string & | infix, |
CMathContainer & | container | ||
) |
Set the delay expression
const | std::string & infix |
CMathContainer | & container |
References mpDelay, and CMathObject::setExpression().
void CMathEvent::setDisabled | ( | const bool & | disabled | ) |
Set whether the event is disabled.
const | bool & disabled |
References mDisabled.
Referenced by CMathContainer::ignoreDiscontinuityEvent().
void CMathEvent::setPriorityExpression | ( | const std::string & | infix, |
CMathContainer & | container | ||
) |
Set the priority expression
const | std::string & infix |
CMathContainer | & container |
References mpPriority, and CMathObject::setExpression().
CMath::StateChange CMathEvent::setTargetValues | ( | const CVectorCore< C_FLOAT64 > & | targetValues | ) |
Set the target values
const | CVectorCore< C_FLOAT64 > & targetValues |
References CMathContainer::applyUpdateSequence(), CVectorCore< CType >::array(), C_FLOAT64, CEvent::Discontinuity, CMathEvent::CAssignment::isStateValue(), mAssignments, mEffectsSimulation, mpContainer, mPostAssignmentSequence, mTargetPointers, mType, CFlags< eStateChange >::None, CVectorCore< CType >::size(), CMath::State, CMathContainer::updateRootValues(), and CMathContainer::updateSimulatedValues().
Referenced by executeAssignment().
void CMathEvent::setTriggerExpression | ( | const std::string & | infix, |
CMathContainer & | container | ||
) |
Set the trigger expression
const | std::string & infix |
CMathContainer | & container |
References mTrigger, and CMathEvent::CTrigger::setExpression().
Referenced by CMathContainer::replaceDiscontinuousNode().
|
friend |
|
private |
The assignments.
Referenced by addAssignment(), allocate(), compile(), copy(), createUpdateSequences(), getAssignments(), initialize(), operator=(), relocate(), and setTargetValues().
|
private |
A Boolean flag indicating whether to delay assignment phase or calculation phase.
Referenced by compile(), delayAssignment(), fire(), getCalculationTime(), getExecutionTime(), and operator=().
|
private |
The update sequence executed prior to creating calculation actions.
Referenced by createUpdateSequences(), getCalculationTime(), getExecutionTime(), and operator=().
|
private |
A Boolean flag indicating whether the even is disabled, i.e., will not fire
Referenced by compile(), fire(), isDisabled(), operator=(), and setDisabled().
|
private |
Flag indicating whether the event effects the discrete and/or the continuous state values.
Referenced by createUpdateSequences(), operator=(), and setTargetValues().
|
private |
A Boolean flag indicating whether the event may fire at the initial time.
Referenced by compile(), fireAtInitialTime(), and operator=().
|
private |
A pointer to an optional callback
Referenced by executeCallback(), operator=(), and setCallback().
|
private |
A pointer to the math container the event queue belongs to.
Referenced by compile(), createUpdateSequences(), fire(), getCalculationTime(), getExecutionTime(), getTargetValues(), operator=(), relocate(), and setTargetValues().
|
private |
A pointer to the delay object.
Referenced by compile(), createUpdateSequences(), getCalculationTime(), getExecutionTime(), initialize(), operator=(), relocate(), and setDelayExpression().
|
private |
The update sequence executed after the new values are assigned to update the state.
Referenced by createUpdateSequences(), operator=(), and setTargetValues().
|
private |
A pointer to the currently pending actions for used for persistent triggers
Referenced by addPendingAction(), fire(), operator=(), removePendingAction(), and ~CMathEvent().
|
private |
A pointer to the priority object.
Referenced by compile(), getPriority(), initialize(), operator=(), relocate(), and setPriorityExpression().
|
private |
A pointer to the current container time
Referenced by compile(), getCalculationTime(), getExecutionTime(), operator=(), and relocate().
Vector of pointers to targets
Referenced by compile(), operator=(), relocate(), and setTargetValues().
|
private |
Vector reference of target Values
Referenced by compile(), getTargetValues(), operator=(), and relocate().
|
private |
The update sequence executed prior to creating assignment actions.
Referenced by createUpdateSequences(), getTargetValues(), and operator=().
|
private |
The trigger expression.
Referenced by allocate(), compile(), copy(), fire(), getTrigger(), initialize(), operator=(), relocate(), and setTriggerExpression().
|
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=().
|
private |
The type of the event.
Referenced by compile(), createUpdateSequences(), fire(), getType(), operator=(), and setTargetValues().