COPASI API  4.16.103
Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
CCrossSectionTask Class Reference

#include <CCrossSectionTask.h>

Inheritance diagram for CCrossSectionTask:
Inheritance graph
[legend]
Collaboration diagram for CCrossSectionTask:
Collaboration graph
[legend]

Public Member Functions

 CCrossSectionTask (const CCopasiContainer *pParent=NULL)
 
 CCrossSectionTask (const CCrossSectionTask &src, const CCopasiContainer *pParent=NULL)
 
void createEvent ()
 
virtual CCopasiMethodcreateMethod (const int &type) const
 
CStategetState ()
 
const CTimeSeriesgetTimeSeries () const
 
virtual bool initialize (const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
 
virtual bool process (const bool &useInitialValues)
 
void processStart (const bool &useInitialValues)
 
bool processStep (const C_FLOAT64 &nextTime)
 
void removeEvent ()
 
virtual bool restore ()
 
virtual bool setMethodType (const int &type)
 
 ~CCrossSectionTask ()
 
- Public Member Functions inherited from CCopasiTask
 CCopasiTask (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
 
 CCopasiTask (const Type &taskType, const CCopasiContainer *pParent=NULL, const std::string &type="Task")
 
 CCopasiTask (const CCopasiTask &src, const CCopasiContainer *pParent=NULL)
 
void cleanup ()
 
CProcessReportgetCallBack () const
 
const CDescriptiongetDescription () const
 
virtual const std::string & getKey () const
 
CCopasiMethodgetMethod ()
 
const CCopasiMethodgetMethod () const
 
COutputHandlergetOutputHandler () const
 
const OutputFlaggetOutputMode () const
 
CCopasiProblemgetProblem ()
 
const CCopasiProblemgetProblem () const
 
CReportgetReport ()
 
const CResultgetResult () const
 
CCopasiParameterGroupgetSliders ()
 
Type getType () const
 
const bool & isScheduled () const
 
const bool & isUpdateModel () const
 
virtual void output (const COutputInterface::Activity &activity)
 
virtual void separate (const COutputInterface::Activity &activity)
 
virtual bool setCallBack (CProcessReport *pCallBack)
 
void setScheduled (const bool &scheduled)
 
void setType (const Type &type)
 
void setUpdateModel (const bool &updateModel)
 
virtual bool updateMatrices ()
 
virtual ~CCopasiTask ()
 
- Public Member Functions inherited from CCopasiContainer
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 CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
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 DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () const
 
virtual voidgetValuePointer () 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 ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Static Public Attributes

static const unsigned int ValidMethods []
 
- Static Public Attributes inherited from CCopasiTask
static const std::string TypeName []
 
static const unsigned int ValidMethods []
 
static const char * XMLType []
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 

Private Types

enum  STATE { TRANSIENT = 0, MAIN, FINISH }
 

Private Member Functions

void cleanup ()
 
void eventCallBack (CEvent::Type type)
 
void finish ()
 
void initObjects ()
 

Static Private Member Functions

static void EventCallBack (void *pCSTask, CEvent::Type type)
 
static C_FLOAT64 relativeDifferenceOfStates (CState *s1, CState *s2)
 

Private Attributes

C_FLOAT64 mAverageFreq
 
C_FLOAT64 mAveragePeriod
 
C_FLOAT64 mFreq
 
size_t mhProgress
 
C_FLOAT64 mLastFreq
 
C_FLOAT64 mLastPeriod
 
size_t mMaxNumCrossings
 
size_t mNumCrossings
 
size_t mOutputStartNumCrossings
 
C_FLOAT64 mOutputStartTime
 
CCrossSectionProblemmpCrossSectionProblem
 
CStatempCurrentState
 
const C_FLOAT64mpCurrentTime
 
C_FLOAT64 mPeriod
 
C_INT mPeriodicity
 
CEventmpEvent
 
C_FLOAT64 mPreviousCrossingTime
 
C_FLOAT64 mProgressFactor
 
C_FLOAT64 mProgressMax
 
C_FLOAT64 mProgressValue
 
CTrajectoryMethodmpTrajectoryMethod
 
C_FLOAT64 mStartTime
 
STATE mState
 
std::vector< CStatemStatesRing
 
size_t mStatesRingCounter
 
CTimeSeries mTimeSeries
 
bool mTimeSeriesRequested
 
bool mUpdateMoieties
 

Additional Inherited Members

- Public Types inherited from CCopasiTask
enum  eOutputFlagBase {
  INITIALIZE = 0x01, STREAM = 0x02, FINISH = 0x04, REPORT = 0x10,
  PLOT = 0x20, TIME_SERIES = 0x40
}
 
enum  OutputFlag {
  NO_OUTPUT = 0, OUTPUT_BEFORE = INITIALIZE, OUTPUT_AFTER = FINISH, OUTPUT = REPORT | PLOT | STREAM,
  OUTPUT_SE = REPORT | PLOT | INITIALIZE | STREAM | FINISH, OUTPUT_UI = REPORT | PLOT | TIME_SERIES | INITIALIZE | STREAM | FINISH, ONLY_TIME_SERIES = TIME_SERIES | INITIALIZE | STREAM | FINISH
}
 
enum  Type {
  steadyState = 0, timeCourse, scan, fluxMode,
  optimization, parameterFitting, mca, lyap,
  tssAnalysis, sens, moieties, crosssection,
  lna, unset
}
 
- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CCopasiTask
static bool isValidMethod (const unsigned int &method, const unsigned int *validMethods)
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Public Attributes inherited from CCopasiTask
std::string Error
 
std::string Warning
 
- Protected Types inherited from CCopasiObject
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 inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Protected Attributes inherited from CCopasiTask
CDescription mDescription
 
OutputFlag mDoOutput
 
std::string mKey
 
unsigned C_INT32 mOutputCounter
 
CProcessReportmpCallBack
 
CStatempInitialState
 
CCopasiMethodmpMethod
 
COutputHandlermpOutputHandler
 
CCopasiProblemmpProblem
 
CCopasiParameterGroupmpSliders
 
CReport mReport
 
CResult mResult
 
bool mScheduled
 
Type mType
 
bool mUpdateModel
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 31 of file CCrossSectionTask.h.

Member Enumeration Documentation

describes the internal state of the calculation

Enumerator
TRANSIENT 
MAIN 
FINISH 

Definition at line 121 of file CCrossSectionTask.h.

122  {
123  TRANSIENT = 0, //before the condition for starting output is met
124  MAIN, //the main part of the run, while output is generated
125  FINISH //when the conditions for finishing are met
126  };

Constructor & Destructor Documentation

CCrossSectionTask::CCrossSectionTask ( const CCopasiContainer pParent = NULL)

Default constructor

Parameters
constCCopasiContainer * pParent (default: NULL)

Definition at line 37 of file CCrossSectionTask.cpp.

References CCopasiContainer::add(), createMethod(), CCopasiMethod::deterministic, initObjects(), CCopasiTask::mpMethod, and CCopasiTask::mpProblem.

37  :
40  mTimeSeries(),
42  mpTrajectoryMethod(NULL),
43  mUpdateMoieties(false),
44  mpCurrentState(NULL),
45  mpCurrentTime(NULL),
46  mOutputStartTime(0.0),
47  mStartTime(0.0),
48  mNumCrossings(0),
52  mProgressMax(1),
53  mProgressValue(0),
54  mProgressFactor(1),
55  mpEvent(NULL),
57  mStatesRing(),
59  mPreviousCrossingTime(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
60  mPeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
61  mAveragePeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
62  mLastPeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
63  mPeriodicity(-1),
64  mLastFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
65  mFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
66  mAverageFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN())
67 {
68  initObjects();
69  mpProblem = new CCrossSectionProblem(this);
71  this->add(mpMethod, true);
72 }
C_FLOAT64 mPreviousCrossingTime
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
CCopasiTask(const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
#define C_INVALID_INDEX
Definition: copasi.h:222
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
const C_FLOAT64 * mpCurrentTime
std::vector< CState > mStatesRing
CTimeSeries mTimeSeries
virtual CCopasiMethod * createMethod(const int &type) const
CTrajectoryMethod * mpTrajectoryMethod
C_FLOAT64 mOutputStartTime
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CCrossSectionProblem * mpCrossSectionProblem
#define max(a, b)
Definition: f2c.h:176
CCrossSectionTask::CCrossSectionTask ( const CCrossSectionTask src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
constCCrossSectionTask & src
constCCopasiContainer * pParent (default: NULL)

Definition at line 74 of file CCrossSectionTask.cpp.

References CCopasiContainer::add(), createMethod(), CCopasiParameterGroup::elevateChildren(), CCopasiMethod::getSubType(), initObjects(), CCopasiTask::mpMethod, and CCopasiTask::mpProblem.

75  :
76  CCopasiTask(src, pParent),
78  mTimeSeries(),
80  mpTrajectoryMethod(NULL),
81  mUpdateMoieties(false),
82  mpCurrentState(NULL),
83  mpCurrentTime(NULL),
84  mOutputStartTime(0.0),
85  mStartTime(0.0),
86  mNumCrossings(0),
90  mProgressMax(1),
91  mProgressValue(0),
92  mProgressFactor(1),
93  mpEvent(NULL),
95  mStatesRing(),
97  mPreviousCrossingTime(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
98  mPeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
99  mAveragePeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
100  mLastPeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
101  mPeriodicity(-1),
102  mLastFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
103  mFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN()),
104  mAverageFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN())
105 {
106  initObjects();
107  mpProblem =
108  new CCrossSectionProblem(*static_cast< CCrossSectionProblem * >(src.mpProblem), this);
109 
111  * mpMethod = * src.mpMethod;
112 
113  mpMethod->elevateChildren();
114 
115  this->add(mpMethod, true);
116 }
C_FLOAT64 mPreviousCrossingTime
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
CCopasiTask(const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
#define C_INVALID_INDEX
Definition: copasi.h:222
const CCopasiMethod::SubType & getSubType() const
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
const C_FLOAT64 * mpCurrentTime
std::vector< CState > mStatesRing
CTimeSeries mTimeSeries
virtual CCopasiMethod * createMethod(const int &type) const
CTrajectoryMethod * mpTrajectoryMethod
C_FLOAT64 mOutputStartTime
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CCrossSectionProblem * mpCrossSectionProblem
#define max(a, b)
Definition: f2c.h:176
CCrossSectionTask::~CCrossSectionTask ( )

Destructor

Definition at line 118 of file CCrossSectionTask.cpp.

References cleanup().

119 {
120  cleanup();
121 }

Member Function Documentation

void CCrossSectionTask::cleanup ( )
private

cleanup()

Definition at line 123 of file CCrossSectionTask.cpp.

References mpCurrentState, and pdelete.

Referenced by ~CCrossSectionTask().

124 {
126 }
#define pdelete(p)
Definition: copasi.h:215
void CCrossSectionTask::createEvent ( )

Definition at line 194 of file CCrossSectionTask.cpp.

References C_INVALID_INDEX, CModel::compileIfNecessary(), CModel::createEvent(), CEvent::CutPlane, CModel::getEvents(), CCopasiVectorN< CType >::getIndex(), CCopasiProblem::getModel(), CCrossSectionProblem::getSingleObjectCN(), CCrossSectionProblem::getThreshold(), CCrossSectionProblem::isPositiveDirection(), mpCrossSectionProblem, mpEvent, CEvent::setTriggerExpression(), and CEvent::setType().

Referenced by initialize(), and CScanTask::process().

195 {
196  if (mpEvent != NULL) return;
197 
199 
201  {
202  int count = 0;
203  std::string name = "__cutplane";
204 
205  while (pModel->getEvents().getIndex(name) != C_INVALID_INDEX)
206  {
207  std::stringstream str;
208  str << "__cutplane" << ++count;
209  name = str.str();
210  }
211 
212  mpEvent = pModel->createEvent(name);
214 
215  std::stringstream expression;
216  expression << "<" << mpCrossSectionProblem->getSingleObjectCN() << "> "
217  << (mpCrossSectionProblem->isPositiveDirection() ? std::string(" > ") : std::string(" < "))
218  << mpCrossSectionProblem->getThreshold();
219 
220  mpEvent ->setTriggerExpression(expression.str());
221 
222  pModel->compileIfNecessary(NULL);
223  }
224 }
const std::string & getSingleObjectCN() const
CEvent * createEvent(const std::string &name)
Definition: CModel.cpp:2928
CCopasiVectorN< CEvent > & getEvents()
Definition: CModel.cpp:1110
#define C_INVALID_INDEX
Definition: copasi.h:222
virtual size_t getIndex(const std::string &name) const
bool setTriggerExpression(const std::string &expression)
Definition: CEvent.cpp:474
bool compileIfNecessary(CProcessReport *pProcessReport)
Definition: CModel.cpp:612
void setType(const Type &type)
Definition: CEvent.cpp:704
Definition: CModel.h:50
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
CCopasiMethod * CCrossSectionTask::createMethod ( const int &  type) const
virtual

Create a method of the specified type to solve the task. It is the duty of the caller to release the CCopasiMethod.

Parameters
constCCopasiMethod::SubType & type
Returns
CCopasiMethod *

Reimplemented from CCopasiTask.

Definition at line 504 of file CCrossSectionTask.cpp.

References CTrajectoryMethod::createMethod().

Referenced by CCrossSectionTask(), and setMethodType().

505 {
507 
508  return CTrajectoryMethod::createMethod(Type);
509 }
static CTrajectoryMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::deterministic)
void CCrossSectionTask::EventCallBack ( void pCSTask,
CEvent::Type  type 
)
staticprivate

this is the static call back function that is called by the process queue when an event is executed-

Definition at line 518 of file CCrossSectionTask.cpp.

References eventCallBack().

Referenced by process().

519 {static_cast<CCrossSectionTask *>(pCSTask)->eventCallBack(type);}
void eventCallBack(CEvent::Type type)
void CCrossSectionTask::eventCallBack ( CEvent::Type  type)
private

This is the member function that is called by the static call back function It checks if an event describes the cut plane and does all the necessary analysis and output in this case

Definition at line 521 of file CCrossSectionTask.cpp.

References C_FLOAT64, CEvent::CutPlane, COutputInterface::DURING, FINISH, CCrossSectionProblem::getFlagLimitConvergence(), CCrossSectionProblem::getFlagLimitOutConvergence(), CCrossSectionProblem::getFlagLimitOutCrossings(), CCrossSectionProblem::getFlagLimitOutTime(), CCopasiProblem::getModel(), MAIN, mAverageFreq, mAveragePeriod, mFreq, mhProgress, mLastFreq, mLastPeriod, mMaxNumCrossings, mNumCrossings, mOutputStartNumCrossings, mOutputStartTime, CCopasiTask::mpCallBack, mpCrossSectionProblem, mpCurrentState, mpCurrentTime, mPeriod, mPeriodicity, CCopasiTask::mpProblem, mPreviousCrossingTime, mProgressFactor, mProgressValue, mStartTime, mState, mStatesRing, mStatesRingCounter, mUpdateMoieties, CCopasiTask::output(), CProcessReport::progressItem(), relativeDifferenceOfStates(), RING_SIZE, CModel::setState(), TRANSIENT, and CModel::updateSimulatedValues().

Referenced by EventCallBack().

522 {
523  // std::cout << "event call back: " << type << std::endl;
524 
525  //do progress reporting
526  if (mpCallBack != NULL)
527  {
529 
531  {
532  mState = FINISH;
533  }
534  }
535 
536  //do nothing else if the event is not representing a cut plane
537  if (type != CEvent::CutPlane)
538  return;
539 
542 
543  // count the crossings
544  ++mNumCrossings;
545 
546  // now check if we can transition to the main state
547  if (mState == TRANSIENT)
548  {
549  // if output is not delayed by time and not delayed by number of crossings
550  // and also not delayed by convergence
551  // output is started immediately
555  {
556  mState = MAIN;
557  }
559  {
560  mState = MAIN;
561  }
563  {
564  mState = MAIN;
565  }
567  mStatesRingCounter > 0)
568  {
569  int i;
570 
571  for (i = mStatesRingCounter - 1; i >= 0 && i >= ((int) mStatesRingCounter) - RING_SIZE; --i)
572  {
575 
576  if (tmp < mpCrossSectionProblem->getConvergenceOutTolerance())
577  {
579  mPeriod = *mpCurrentTime - mStatesRing[i % RING_SIZE].getTime();
580  mFreq = 1 / mPeriod;
583 
584  mState = MAIN;
585  break;
586  }
587 
588  //std::cout << i << " " << tmp << std::endl;
589  }
590  }
591 
592  if (mState == MAIN)
593  {
594  mStatesRingCounter = 0;
595  mNumCrossings = 1;
596  }
597  }
598 
599  if (mState == MAIN)
600  {
601  //check for convergence (actually for the occurrence of similar states)
602  if (mStatesRingCounter > 0)
603  {
604  int i;
605 
606  for (i = mStatesRingCounter - 1; i >= 0 && i >= ((int) mStatesRingCounter) - RING_SIZE; --i)
607  {
610 
611  if (tmp < mpCrossSectionProblem->getConvergenceTolerance())
612  {
614  mPeriod = *mpCurrentTime - mStatesRing[i % RING_SIZE].getTime();
615  mFreq = 1 / mPeriod;
618 
620  mState = FINISH;
621 
622  break;
623  }
624 
625  //std::cout << "MAIN" << i << " " << tmp << std::endl;
626  }
627  }
628 
629  if (!isnan(mPreviousCrossingTime))
630  {
632  }
633 
634  mLastFreq = 1 / mLastPeriod;
635 
637 
638  //check if the conditions for stopping are met
639  //we don't have to check for maximum duration, this is done elsewhere
641  mState = FINISH;
642  }
643 
644  //store state in ring buffer
648 }
C_FLOAT64 mPreviousCrossingTime
void updateSimulatedValues(const bool &updateMoieties)
Definition: CModel.cpp:1851
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
virtual void output(const COutputInterface::Activity &activity)
virtual bool progressItem(const size_t &handle)
bool getFlagLimitConvergence() const
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
const C_FLOAT64 * mpCurrentTime
void setState(const CState &state)
Definition: CModel.cpp:1785
std::vector< CState > mStatesRing
bool getFlagLimitOutCrossings() const
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 mOutputStartTime
bool getFlagLimitOutConvergence() const
#define RING_SIZE
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
static C_FLOAT64 relativeDifferenceOfStates(CState *s1, CState *s2)
void CCrossSectionTask::finish ( )
private

should be called by all code paths that finish the task. -finishes progress reporting -finishes output -resets call back function

Definition at line 449 of file CCrossSectionTask.cpp.

References COutputInterface::AFTER, CProcessReport::finishItem(), CModel::getMathModel(), CCopasiProblem::getModel(), CMathModel::getProcessQueue(), mhProgress, CCopasiTask::mpCallBack, mpCrossSectionProblem, CCopasiTask::output(), and CProcessQueue::setEventCallBack().

Referenced by process(), and processStep().

450 {
451  //reset call back
453 
455 
457 }
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
const CMathModel * getMathModel() const
Definition: CModel.cpp:4722
virtual void output(const COutputInterface::Activity &activity)
void setEventCallBack(void *pTask, EventCallBack ecb)
virtual bool finishItem(const size_t &handle)
const CProcessQueue & getProcessQueue() const
Definition: CMathModel.cpp:362
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
CState * CCrossSectionTask::getState ( )

Retrieves a pointer to current state of the integration.

Returns
CState * pState

Definition at line 511 of file CCrossSectionTask.cpp.

References mpCurrentState.

512 {return mpCurrentState;}
const CTimeSeries & CCrossSectionTask::getTimeSeries ( ) const

gets a reference to the time series

Returns
time series

Definition at line 514 of file CCrossSectionTask.cpp.

References mTimeSeries.

Referenced by getTimeSeriesFromTask().

515 {return mTimeSeries;}
CTimeSeries mTimeSeries
bool CCrossSectionTask::initialize ( const OutputFlag of,
COutputHandler pOutputHandler,
std::ostream *  pOstream 
)
virtual

Initialize the task. If an ostream is given this ostream is used instead of the target specified in the report. This allows nested tasks to share the same output device.

Parameters
constOutputFlag & of
COutputHandler* pOutputHandler
std::ostream* pOstream (default: NULL)
Returns
bool success

Reimplemented from CCopasiTask.

Definition at line 141 of file CCrossSectionTask.cpp.

References COutputHandler::addInterface(), CTimeSeries::allocate(), CTimeSeries::clear(), createEvent(), CCopasiProblem::getModel(), CCopasiParameterGroup::getParameter(), CModel::getState(), CState::getTime(), CCopasiParameter::getValue(), CCopasiTask::initialize(), CCopasiMethod::isValidProblem(), mpCrossSectionProblem, mpCurrentState, mpCurrentTime, CCopasiTask::mpMethod, CCopasiTask::mpProblem, mpTrajectoryMethod, mStatesRing, mStatesRingCounter, mTimeSeries, mTimeSeriesRequested, mUpdateMoieties, CCopasiParameter::Value::pBOOL, pdelete, RING_SIZE, CTrajectoryMethod::setProblem(), and CCopasiTask::TIME_SERIES.

144 {
145  assert(mpProblem && mpMethod);
146 
148  assert(mpCrossSectionProblem);
149 
150  mpTrajectoryMethod = dynamic_cast<CTrajectoryMethod *>(mpMethod);
151  assert(mpTrajectoryMethod);
152 
154 
155  bool success = mpMethod->isValidProblem(mpProblem);
156 
157  CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
158 
159  if (pParameter != NULL)
160  mUpdateMoieties = *pParameter->getValue().pBOOL;
161  else
162  mUpdateMoieties = false;
163 
167 
168  //init the ring buffer for the states
169  mStatesRing.resize(RING_SIZE);
170  mStatesRingCounter = 0;
171 
172  // Handle the time series as a regular output.
173  mTimeSeriesRequested = true;//mpCrossSectionProblem->timeSeriesRequested();
174 
175  if ((pOutputHandler != NULL) &&
178  {
179  mTimeSeries.allocate(20);
180  pOutputHandler->addInterface(&mTimeSeries);
181  }
182  else
183  {
184  mTimeSeries.clear();
185  }
186 
187  createEvent();
188 
189  if (!CCopasiTask::initialize(of, pOutputHandler, pOstream)) success = false;
190 
191  return success;
192 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
#define pdelete(p)
Definition: copasi.h:215
void clear()
Definition: CTimeSeries.cpp:96
void setProblem(CTrajectoryProblem *problem)
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
void allocate(const size_t &steps)
Definition: CTimeSeries.cpp:73
Definition: CState.h:305
virtual bool isValidProblem(const CCopasiProblem *pProblem)
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual void addInterface(COutputInterface *pInterface)
const C_FLOAT64 * mpCurrentTime
const Value & getValue() const
std::vector< CState > mStatesRing
CTimeSeries mTimeSeries
CCopasiParameter * getParameter(const std::string &name)
CTrajectoryMethod * mpTrajectoryMethod
const C_FLOAT64 & getTime() const
Definition: CState.cpp:325
const CState & getState() const
Definition: CModel.cpp:1771
#define RING_SIZE
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
void CCrossSectionTask::initObjects ( )
private

initialize the object references

Definition at line 128 of file CCrossSectionTask.cpp.

References CCopasiContainer::addObjectReference(), mAverageFreq, mAveragePeriod, mFreq, mLastFreq, mLastPeriod, mPeriod, mPeriodicity, CCopasiObject::ValueDbl, and CCopasiObject::ValueInt.

Referenced by CCrossSectionTask().

129 {
137 }
CCopasiObject * addObjectReference(const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
bool CCrossSectionTask::process ( const bool &  useInitialValues)
virtual

Process the task with or without initializing to the initial state.

Parameters
constbool & useInitialValues
Returns
bool success

Reimplemented from CCopasiTask.

Definition at line 236 of file CCrossSectionTask.cpp.

References CProcessReport::addItem(), COutputInterface::BEFORE, C_FLOAT64, EventCallBack(), CCopasiMessage::EXCEPTION, finish(), CCrossSectionProblem::getCrossingsLimit(), CTrajectoryProblem::getDuration(), CCrossSectionProblem::getFlagLimitCrossings(), CCrossSectionProblem::getFlagLimitOutCrossings(), CCrossSectionProblem::getFlagLimitOutTime(), CModel::getMathModel(), CCopasiException::getMessage(), CCopasiProblem::getModel(), CCrossSectionProblem::getOutCrossingsLimit(), CTrajectoryProblem::getOutputStartTime(), CMathModel::getProcessQueue(), mAverageFreq, mAveragePeriod, MCTrajectoryMethod, mFreq, mhProgress, min, mLastFreq, mLastPeriod, mMaxNumCrossings, mNumCrossings, mOutputStartNumCrossings, mOutputStartTime, CCopasiTask::mpCallBack, mpCrossSectionProblem, mpCurrentState, mpCurrentTime, mPeriod, mPeriodicity, mPreviousCrossingTime, mProgressFactor, mProgressMax, mProgressValue, mStartTime, mState, mStatesRingCounter, mUpdateMoieties, CCopasiTask::output(), processStart(), processStep(), CProcessQueue::setEventCallBack(), CProcessReport::setName(), CModel::setState(), TRANSIENT, and CModel::updateSimulatedValues().

237 {
238  processStart(useInitialValues);
239 
240  //this instructs the process queue to call back whenever an event is
241  //executed
243 
244  mPreviousCrossingTime = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
245  mPeriod = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
246  mAveragePeriod = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
247  mLastPeriod = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
248  mPeriodicity = -1;
249  mLastFreq = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
250  mFreq = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
251  mAverageFreq = std::numeric_limits< C_FLOAT64 >::quiet_NaN();
252 
254 
255  //the output starts only after "outputStartTime" has passed
257  {
259  MaxDuration += mpCrossSectionProblem->getOutputStartTime();
260  }
261  else
262  {
264  }
265 
266  const C_FLOAT64 EndTime = *mpCurrentTime + MaxDuration;
267 
269 
270  // It suffices to reach the end time within machine precision
271  C_FLOAT64 CompareEndTime = mOutputStartTime - 100.0 * (fabs(EndTime) * std::numeric_limits< C_FLOAT64 >::epsilon() + std::numeric_limits< C_FLOAT64 >::min());
272 
275  else
276  mMaxNumCrossings = 0;
277 
280  else
282 
284 
285  bool flagProceed = true;
286  mProgressFactor = 100.0 / (MaxDuration + mpCrossSectionProblem->getOutputStartTime());
287  mProgressValue = 0;
288 
289  if (mpCallBack != NULL)
290  {
291  mpCallBack->setName("performing simulation...");
292  mProgressMax = 100.0;
293  mhProgress = mpCallBack->addItem("Completion",
295  &mProgressMax);
296  }
297 
298  mState = TRANSIENT;
299  mStatesRingCounter = 0;
300 
301  mNumCrossings = 0;
302 
303  try
304  {
305  do
306  {
307  flagProceed &= processStep(EndTime);
308  }
309  while ((*mpCurrentTime < CompareEndTime) && flagProceed);
310  }
311 
312  catch (int)
313  {
316  finish();
318  }
319 
320  catch (CCopasiException & Exception)
321  {
324  finish();
325  throw CCopasiException(Exception.getMessage());
326  }
327 
328  finish();
329 
330  return true;
331 }
C_FLOAT64 mPreviousCrossingTime
bool getFlagLimitCrossings() const
const CCopasiMessage & getMessage() const
virtual bool setName(const std::string &name)
void updateSimulatedValues(const bool &updateMoieties)
Definition: CModel.cpp:1851
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
void processStart(const bool &useInitialValues)
const CMathModel * getMathModel() const
Definition: CModel.cpp:4722
virtual void output(const COutputInterface::Activity &activity)
#define MCTrajectoryMethod
const C_FLOAT64 * mpCurrentTime
void setState(const CState &state)
Definition: CModel.cpp:1785
size_t addItem(const std::string &name, const std::string &value, const std::string *pEndValue=NULL)
const C_FLOAT64 & getDuration() const
void setEventCallBack(void *pTask, EventCallBack ecb)
const unsigned C_INT32 & getCrossingsLimit() const
const unsigned C_INT32 & getOutCrossingsLimit() const
const C_FLOAT64 & getOutputStartTime() const
bool getFlagLimitOutCrossings() const
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 mOutputStartTime
static void EventCallBack(void *pCSTask, CEvent::Type type)
bool processStep(const C_FLOAT64 &nextTime)
const CProcessQueue & getProcessQueue() const
Definition: CMathModel.cpp:362
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
#define min(a, b)
Definition: f2c.h:175
void CCrossSectionTask::processStart ( const bool &  useInitialValues)

Starts the process of integration by calling CTrajectoryMethod::start

Parameters
constbool & useInitialValues

Definition at line 333 of file CCrossSectionTask.cpp.

References CModel::applyInitialValues(), CCopasiProblem::getModel(), CModel::getState(), mpCrossSectionProblem, mpCurrentState, mpTrajectoryMethod, CTrajectoryMethod::setCurrentState(), and CTrajectoryMethod::start().

Referenced by process().

334 {
335  if (useInitialValues)
337 
339 
342 
343  return;
344 }
void setCurrentState(CState *currentState)
void applyInitialValues()
Definition: CModel.cpp:1236
virtual void start(const CState *initialState)
CTrajectoryMethod * mpTrajectoryMethod
const CState & getState() const
Definition: CModel.cpp:1771
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
bool CCrossSectionTask::processStep ( const C_FLOAT64 nextTime)

Integrates one step

Parameters
constC_FLOAT64 & nextTime
Returns
bool success;

Definition at line 346 of file CCrossSectionTask.cpp.

References C_FLOAT64, CCopasiMessage::EXCEPTION, CTrajectoryMethod::FAILURE, FINISH, finish(), CCopasiProblem::getModel(), CModel::getProcessQueueExecutionTime(), CTrajectoryMethod::getRoots(), CModel::getState(), MCTrajectoryMethod, min, CCopasiTask::mpCallBack, mpCrossSectionProblem, mpCurrentState, mpCurrentTime, mpTrajectoryMethod, mState, mUpdateMoieties, CTrajectoryMethod::NORMAL, CProcessReport::proceed(), CModel::processQueue(), CModel::processRoots(), CTrajectoryMethod::ROOT, CModel::setState(), CTrajectoryMethod::stateChanged(), CTrajectoryMethod::step(), and CModel::updateSimulatedValues().

Referenced by process().

347 {
348  CModel * pModel = mpCrossSectionProblem->getModel();
349  bool StateChanged = false;
350  bool proceed = true;
351 
352  C_FLOAT64 Tolerance = 100.0 * (fabs(endTime) * std::numeric_limits< C_FLOAT64 >::epsilon() + std::numeric_limits< C_FLOAT64 >::min());
353  C_FLOAT64 NextTime = endTime;
354 
355  while (proceed)
356  {
357  // TODO Provide a call back method for resolving simultaneous assignments.
358  //pModel->getMathModel()->getProcessQueue().printDebug();
359 
360  //execute events for inequalities
361  StateChanged |= pModel->processQueue(*mpCurrentTime, false, NULL);
362 
363  if (StateChanged)
364  {
365  *mpCurrentState = pModel->getState();
367  StateChanged = false;
368  }
369 
370  // std::min suffices since events are only supported in forward integration.
371  NextTime = std::min(endTime, pModel->getProcessQueueExecutionTime());
372 
373  switch (mpTrajectoryMethod->step(NextTime - *mpCurrentTime))
374  {
376  pModel->setState(*mpCurrentState);
378 
379  // TODO Provide a call back method for resolving simultaneous assignments.
380 
381  //execute events for equalities
382  StateChanged |= pModel->processQueue(*mpCurrentTime, true, NULL);
383 
384  // If the state change happens to coincide with end of the step we have to return and
385  // inform the integrator of eventual state changes.
386  if (fabs(*mpCurrentTime - endTime) < Tolerance)
387  {
388  if (StateChanged)
389  {
390  *mpCurrentState = pModel->getState();
392  StateChanged = false;
393  }
394 
395  return true;
396  }
397 
398  break;
399 
401  //we arrive here whenever the integrator finds a root
402  //this does not necessarily mean an event fires
403  pModel->setState(*mpCurrentState);
405 
406  //this checks whether equality events are triggered
407  pModel->processRoots(*mpCurrentTime, true, true, mpTrajectoryMethod->getRoots());
408 
409  // TODO Provide a call back method for resolving simultaneous assignments.
410 
411  //execute scheduled events for equalities
412  StateChanged |= pModel->processQueue(*mpCurrentTime, true, NULL);
413 
414  //this checks whether inequality events are triggered
415  pModel->processRoots(*mpCurrentTime, false, true, mpTrajectoryMethod->getRoots());
416 
417  // If the root happens to coincide with end of the step we have to return and
418  // inform the integrator of eventual state changes.
419  if (fabs(*mpCurrentTime - endTime) < Tolerance)
420  {
421  if (StateChanged)
422  {
423  *mpCurrentState = pModel->getState();
425  StateChanged = false;
426  }
427 
428  return true;
429  }
430 
431  break;
432 
434  finish();
436  return false;
437  break;
438  }
439 
440  proceed = mpCallBack == NULL || mpCallBack->proceed();
441 
442  if (mState == FINISH)
443  proceed = false;
444  }
445 
446  return proceed;
447 }
virtual void stateChanged()
void updateSimulatedValues(const bool &updateMoieties)
Definition: CModel.cpp:1851
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
const CVector< C_INT > & getRoots() const
virtual bool proceed()
#define MCTrajectoryMethod
const C_FLOAT64 * mpCurrentTime
void setState(const CState &state)
Definition: CModel.cpp:1785
void processRoots(const C_FLOAT64 &time, const bool &equality, const bool &correct, const CVector< C_INT > &roots)
Definition: CModel.cpp:4692
CTrajectoryMethod * mpTrajectoryMethod
bool processQueue(const C_FLOAT64 &time, const bool &equality, CProcessQueue::resolveSimultaneousAssignments pResolveSimultaneousAssignments)
Definition: CModel.cpp:4685
#define C_FLOAT64
Definition: copasi.h:92
const C_FLOAT64 & getProcessQueueExecutionTime() const
Definition: CModel.cpp:4702
Definition: CModel.h:50
const CState & getState() const
Definition: CModel.cpp:1771
virtual Status step(const double &deltaT)
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
#define min(a, b)
Definition: f2c.h:175
C_FLOAT64 CCrossSectionTask::relativeDifferenceOfStates ( CState s1,
CState s2 
)
staticprivate

Definition at line 651 of file CCrossSectionTask.cpp.

References CState::beginIndependent(), C_FLOAT64, and CState::endIndependent().

Referenced by eventCallBack().

652 {
653  if (!s1 || !s2)
654  {
655  return std::numeric_limits< C_FLOAT64 >::quiet_NaN();
656  }
657 
658  if (s1->endIndependent() - s1->beginIndependent()
659  != s2->endIndependent() - s2->beginIndependent())
660  {
661  return std::numeric_limits< C_FLOAT64 >::quiet_NaN();
662  }
663 
664  C_FLOAT64 ret = 0;
665 
666  const C_FLOAT64 * p1 = s1->beginIndependent();
667  const C_FLOAT64 * p1End = s1->endIndependent();
668  const C_FLOAT64 * p2 = s2->beginIndependent();
669 
670  for (; p1 != p1End; ++p1, ++p2)
671  {
672  ret += (*p1 != *p2) ? pow((*p1 - *p2) / (fabs(*p1) + fabs(*p2)), 2) : 0.0;
673  }
674 
675  return 2.0 * sqrt(ret);
676 }
C_FLOAT64 * endIndependent()
Definition: CState.cpp:329
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 * beginIndependent()
Definition: CState.cpp:328
void CCrossSectionTask::removeEvent ( )

Definition at line 226 of file CCrossSectionTask.cpp.

References CCopasiProblem::getModel(), mpCrossSectionProblem, mpEvent, and CModel::removeEvent().

Referenced by CScanTask::process(), and restore().

227 {
228  // TODO: remove event
229  if (mpEvent != NULL)
230  {
232  mpEvent = NULL;
233  }
234 }
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
bool removeEvent(const size_t index, const bool &recursive=true)
Definition: CModel.cpp:2945
bool CCrossSectionTask::restore ( )
virtual

Perform necessary cleanup procedures

Reimplemented from CCopasiTask.

Definition at line 459 of file CCrossSectionTask.cpp.

References CModel::getMathModel(), CCopasiProblem::getModel(), CMathModel::getProcessQueue(), CModel::getState(), mpCrossSectionProblem, mpCurrentState, CCopasiTask::mpProblem, CCopasiTask::mUpdateModel, mUpdateMoieties, removeEvent(), CCopasiTask::restore(), CProcessQueue::setEventCallBack(), CModel::setInitialState(), CModel::setState(), CModel::updateInitialValues(), and CModel::updateSimulatedValues().

460 {
461  bool success = CCopasiTask::restore();
462  CModel * pModel = mpProblem->getModel();
463 
464  removeEvent();
465 
466  if (mUpdateModel)
467  {
468 
469  pModel->setState(*mpCurrentState);
471  pModel->setInitialState(pModel->getState());
472  pModel->updateInitialValues();
473  }
474 
475  //reset call back
477 
478  return success;
479 }
void setInitialState(const CState &state)
Definition: CModel.cpp:1774
void updateSimulatedValues(const bool &updateMoieties)
Definition: CModel.cpp:1851
const CMathModel * getMathModel() const
Definition: CModel.cpp:4722
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
void setState(const CState &state)
Definition: CModel.cpp:1785
void setEventCallBack(void *pTask, EventCallBack ecb)
bool mUpdateModel
Definition: CCopasiTask.h:223
bool updateInitialValues()
Definition: CModel.cpp:1461
Definition: CModel.h:50
const CState & getState() const
Definition: CModel.cpp:1771
virtual bool restore()
const CProcessQueue & getProcessQueue() const
Definition: CMathModel.cpp:362
CCrossSectionProblem * mpCrossSectionProblem
CModel * getModel() const
bool CCrossSectionTask::setMethodType ( const int &  type)
virtual

Set the method type applied to solve the task

Parameters
constCCopasiMethod::SubType & type
Returns
bool success

Reimplemented from CCopasiTask.

Definition at line 481 of file CCrossSectionTask.cpp.

References CCopasiContainer::add(), createMethod(), CCopasiParameterGroup::getParameter(), CCopasiMethod::getSubType(), CCopasiParameter::getValue(), CCopasiTask::isValidMethod(), CCopasiTask::mpMethod, mUpdateMoieties, CCopasiParameter::Value::pBOOL, pdelete, and ValidMethods.

482 {
484 
485  if (!isValidMethod(Type, ValidMethods)) return false;
486 
487  if (mpMethod->getSubType() == Type) return true;
488 
489  pdelete(mpMethod);
490  mpMethod = createMethod(Type);
491  this->add(mpMethod, true);
492 
493  CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model");
494 
495  if (pParameter != NULL)
496  mUpdateMoieties = *pParameter->getValue().pBOOL;
497  else
498  mUpdateMoieties = false;
499 
500  return true;
501 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
#define pdelete(p)
Definition: copasi.h:215
const CCopasiMethod::SubType & getSubType() const
const Value & getValue() const
virtual CCopasiMethod * createMethod(const int &type) const
CCopasiParameter * getParameter(const std::string &name)
static bool isValidMethod(const unsigned int &method, const unsigned int *validMethods)
Definition: CCopasiTask.cpp:89
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
static const unsigned int ValidMethods[]

Member Data Documentation

C_FLOAT64 CCrossSectionTask::mAverageFreq
private

Definition at line 143 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initObjects(), and process().

C_FLOAT64 CCrossSectionTask::mAveragePeriod
private

Definition at line 138 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initObjects(), and process().

C_FLOAT64 CCrossSectionTask::mFreq
private

Definition at line 142 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initObjects(), and process().

size_t CCrossSectionTask::mhProgress
private

handle for progress reporting

Definition at line 96 of file CCrossSectionTask.h.

Referenced by eventCallBack(), finish(), and process().

C_FLOAT64 CCrossSectionTask::mLastFreq
private

Definition at line 141 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initObjects(), and process().

C_FLOAT64 CCrossSectionTask::mLastPeriod
private

Definition at line 139 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initObjects(), and process().

size_t CCrossSectionTask::mMaxNumCrossings
private

Definition at line 91 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

size_t CCrossSectionTask::mNumCrossings
private

Definition at line 87 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

size_t CCrossSectionTask::mOutputStartNumCrossings
private

Definition at line 89 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

C_FLOAT64 CCrossSectionTask::mOutputStartTime
private

time at which the output starts.

Definition at line 80 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

CCrossSectionProblem* CCrossSectionTask::mpCrossSectionProblem
private

A pointer to the trajectory Problem

Definition at line 55 of file CCrossSectionTask.h.

Referenced by createEvent(), eventCallBack(), finish(), initialize(), process(), processStart(), processStep(), removeEvent(), and restore().

CState* CCrossSectionTask::mpCurrentState
private

A pointer to the current state of the integration.

Definition at line 70 of file CCrossSectionTask.h.

Referenced by cleanup(), eventCallBack(), getState(), initialize(), process(), processStart(), processStep(), and restore().

const C_FLOAT64* CCrossSectionTask::mpCurrentTime
private

A pointer to the current time of the integration.

Definition at line 75 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initialize(), process(), and processStep().

C_FLOAT64 CCrossSectionTask::mPeriod
private

Definition at line 137 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initObjects(), and process().

C_INT CCrossSectionTask::mPeriodicity
private

Definition at line 140 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initObjects(), and process().

CEvent* CCrossSectionTask::mpEvent
private

temporary event

Definition at line 116 of file CCrossSectionTask.h.

Referenced by createEvent(), and removeEvent().

C_FLOAT64 CCrossSectionTask::mPreviousCrossingTime
private

Definition at line 136 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

C_FLOAT64 CCrossSectionTask::mProgressFactor
private

this holds the current value for the progress reporting

Definition at line 111 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

C_FLOAT64 CCrossSectionTask::mProgressMax
private

this holds the max value for the progress reporting

Definition at line 101 of file CCrossSectionTask.h.

Referenced by process().

C_FLOAT64 CCrossSectionTask::mProgressValue
private

this holds the current value for the progress reporting

Definition at line 106 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

CTrajectoryMethod* CCrossSectionTask::mpTrajectoryMethod
private

A pointer to the trajectory method

Definition at line 60 of file CCrossSectionTask.h.

Referenced by initialize(), processStart(), and processStep().

C_FLOAT64 CCrossSectionTask::mStartTime
private

time at which the simulation starts.

Definition at line 85 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and process().

STATE CCrossSectionTask::mState
private

Definition at line 128 of file CCrossSectionTask.h.

Referenced by eventCallBack(), process(), and processStep().

std::vector< CState > CCrossSectionTask::mStatesRing
private

Definition at line 130 of file CCrossSectionTask.h.

Referenced by eventCallBack(), and initialize().

size_t CCrossSectionTask::mStatesRingCounter
private

Definition at line 134 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initialize(), and process().

CTimeSeries CCrossSectionTask::mTimeSeries
private

the time series (if requested)

Definition at line 50 of file CCrossSectionTask.h.

Referenced by getTimeSeries(), and initialize().

bool CCrossSectionTask::mTimeSeriesRequested
private

whether the time series should be stored in mTimeSeries

Definition at line 45 of file CCrossSectionTask.h.

Referenced by initialize().

bool CCrossSectionTask::mUpdateMoieties
private

Indicates whether we need to update moieties.

Definition at line 65 of file CCrossSectionTask.h.

Referenced by eventCallBack(), initialize(), process(), processStep(), restore(), and setMethodType().

const unsigned int CCrossSectionTask::ValidMethods
static
Initial value:

The methods which can be selected for performing this task.

CCrossSectionTask class.

This class implements a cross section task.

Definition at line 38 of file CCrossSectionTask.h.

Referenced by setMethodType().


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