COPASI API  4.16.103
CCrossSectionProblem.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 #include "CCrossSectionProblem.h"
8 
10  CTrajectoryProblem(pParent),
11  mpFlagLimitCrossings(NULL),
12  mpCrossingsLimit(NULL),
13  mpFlagLimitConvergence(NULL),
14  mpConvergenceTolerance(NULL),
15  mpFlagLimitOutConvergence(NULL),
16  mpConvergenceOutTolerance(NULL),
17  mpFlagLimitOutCrossings(NULL),
18  mpOutCrossingsLimit(NULL),
19  mpFlagLimitOutTime(NULL),
20  mSingleObjectCN(NULL),
21  mpFlagPositiveDirection(NULL),
22  mpThreshold(NULL)
23 {
25  initObjects();
27 }
28 
30  const CCopasiContainer * pParent):
31  CTrajectoryProblem(src, pParent),
32  mpFlagLimitCrossings(NULL),
33  mpCrossingsLimit(NULL),
34  mpFlagLimitConvergence(NULL),
35  mpConvergenceTolerance(NULL),
36  mpFlagLimitOutConvergence(NULL),
37  mpConvergenceOutTolerance(NULL),
38  mpFlagLimitOutCrossings(NULL),
39  mpOutCrossingsLimit(NULL),
40  mpFlagLimitOutTime(NULL),
41  mSingleObjectCN(NULL),
42  mpFlagPositiveDirection(NULL),
43  mpThreshold(NULL)
44 {
46  initObjects();
48 }
49 
51 {
53  mpCrossingsLimit = assertParameter("NumCrossingsLimit", CCopasiParameter::UINT, (unsigned C_INT32)0)->getValue().pUINT;
57  mpOutCrossingsLimit = assertParameter("NumOutCrossingsLimit", CCopasiParameter::UINT, (unsigned C_INT32)0)->getValue().pUINT;
58  mpFlagLimitConvergence = assertParameter("LimitUntilConvergence", CCopasiParameter::BOOL, false)->getValue().pBOOL;
61  mpFlagLimitOutConvergence = assertParameter("DelayOutputUntilConvergence", CCopasiParameter::BOOL, false)->getValue().pBOOL;
64  assertParameter("TriggerExpression", CCopasiParameter::EXPRESSION, std::string(""))->getValue().pEXPRESSION;
66 }
67 
69 {
70  //here we should create things like object references to results of the calculation
71 }
72 
73 /**
74  * Destructor.
75  */
78 
79 std::ostream &operator<<(std::ostream &os, const CCrossSectionProblem & o)
80 {
81  os << "Cross Section Problem description: Not implemented yet." << std::endl;
82  const CCopasiDataModel* pDataModel = o.getObjectDataModel();
83  assert(pDataModel != NULL);
84 
85  return os;
86 }
87 
88 void CCrossSectionProblem::print(std::ostream * ostream) const
89 {*ostream << *this;}
90 
92 {return *mpFlagLimitCrossings;}
93 
95 {return *mpCrossingsLimit;}
96 
98 {return *mpFlagLimitOutCrossings;}
99 
101 {return *mpOutCrossingsLimit;}
102 
104 {return *mpFlagLimitOutTime;}
105 
107 {return *mpDuration;}
108 
110 {
111  return *mpFlagPositiveDirection;
112 }
114 {
115  *mpFlagPositiveDirection = isPositive;
116 }
117 
119 {*mpFlagLimitCrossings = flagLimitCrossing;}
120 
121 void CCrossSectionProblem::setCrossingsLimit(const unsigned C_INT32 &crossingLimit)
122 {*mpCrossingsLimit = crossingLimit;}
123 
125 {*mpFlagLimitOutCrossings = flagLimitCrossing;}
126 
127 void CCrossSectionProblem::setOutCrossingsLimit(const unsigned C_INT32 &crossingLimit)
128 {*mpOutCrossingsLimit = crossingLimit;}
129 
131 {*mpFlagLimitOutTime = flagLimitTime;}
132 
134 {*mpDuration = timeLimit;}
135 
136 /**
137  * return the variable
138  */
139 const std::string& CCrossSectionProblem::getSingleObjectCN() const
140 {
141  return *mSingleObjectCN;
142 }
143 
145 {
146  if (pObject == NULL) return;
147 
148  setSingleObjectCN(pObject->getCN());
149 }
150 
152 {
153  return *mpThreshold;
154 }
156 {
157  *mpThreshold = threshold;
158 }
159 
160 /*
161  * set the variable
162  */
163 void CCrossSectionProblem::setSingleObjectCN(const std::string& cn)
164 {
165  *mSingleObjectCN = cn;
166 }
167 
169 {
170  return *mpFlagLimitConvergence;
171 }
172 
174 {
175  return *mpConvergenceTolerance;
176 }
177 
178 void CCrossSectionProblem::setFlagLimitConvergence(bool flagLimitConvergence)
179 {
180  *mpFlagLimitConvergence = flagLimitConvergence;
181 }
182 
184 {
185  *mpConvergenceTolerance = convergenceTolerance;
186 }
187 
189 {
191 }
192 
194 {
196 }
197 
199 {
200  *mpFlagLimitOutConvergence = flagLimitConvergence;
201 }
202 
204 {
205  *mpConvergenceOutTolerance = convergenceTolerance;
206 }
CCopasiDataModel * getObjectDataModel()
const C_FLOAT64 & getTimeLimit() const
void setTimeLimit(const C_FLOAT64 &timeLimit)
const std::string & getSingleObjectCN() const
void setCrossingsLimit(const unsigned C_INT32 &crossingLimit)
virtual CCopasiObjectName getCN() const
C_FLOAT64 * mpConvergenceOutTolerance
bool getFlagLimitCrossings() const
void setConvergenceTolerance(const C_FLOAT64 &convergenceTolerance)
void setThreshold(const C_FLOAT64 &threshold)
void setFlagLimitOutTime(bool flagLimitTime)
const C_FLOAT64 & getConvergenceOutTolerance() const
void setFlagLimitConvergence(bool flagLimitConvergence)
#define C_INT32
Definition: copasi.h:90
std::string * mpTriggerExpression
void setPositiveDirection(bool isPositive)
CRegisteredObjectName * pCN
bool getFlagLimitConvergence() const
std::ostream & operator<<(std::ostream &os, const CCrossSectionProblem &o)
#define DESTRUCTOR_TRACE
Definition: copasi.h:206
void setFlagLimitOutCrossings(bool flagLimitCrossing)
void setFlagLimitCrossings(bool flagLimitCrossing)
virtual void print(std::ostream *ostream) const
const Value & getValue() const
const C_FLOAT64 & getThreshold() const
unsigned C_INT32 * pUINT
unsigned C_INT32 * mpCrossingsLimit
void setConvergenceOutTolerance(const C_FLOAT64 &convergenceTolerance)
CCrossSectionProblem(const CCopasiContainer *pParent=NULL)
const unsigned C_INT32 & getCrossingsLimit() const
const unsigned C_INT32 & getOutCrossingsLimit() const
const C_FLOAT64 & getConvergenceTolerance() const
bool getFlagLimitOutCrossings() const
#define C_FLOAT64
Definition: copasi.h:92
void setSingleObjectCN(const std::string &cn)
bool getFlagLimitOutConvergence() const
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
void setFlagLimitOutConvergence(bool flagLimitConvergence)
void setOutCrossingsLimit(const unsigned C_INT32 &crossingLimit)
unsigned C_INT32 * mpOutCrossingsLimit
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202