COPASI API  4.16.103
CCopasiProblem.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/utilities/CCopasiProblem.h,v $
3 // $Revision: 1.21 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2008/03/12 00:33:30 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 /**
19  * CCopasiProblem class.
20  * This class is used to describe a problem in COPASI. This class is
21  * intended to be used as the parent class for all problems whithin COPASI.
22  *
23  * Created for Copasi by Stefan Hoops 2003
24  */
25 
26 #ifndef COPASI_CCopasiProblem
27 #define COPASI_CCopasiProblem
28 
29 #include <string>
30 
32 #include "utilities/CVector.h"
33 #include "utilities/CCopasiTask.h"
34 //#include "model/CState.h"
35 
36 class CModel;
37 class CProcessReport;
38 class CReport;
39 
41  {
42  // Attributes
43  private:
44  /**
45  * The type of the problem
46  */
48 
49  protected:
50  /**
51  * The model of the problem
52  */
54 
55  /**
56  * a pointer to the callback
57  */
59 
60  /**
61  * A pointer to the report
62  */
64 
65  // propably for optimization only
66 #ifdef XXXX
67  /**
68  * A vector of variables for calculate
69  */
70  CVector< C_FLOAT64 > mCalculateVariables;
71 
72  /**
73  * A vector of results for calculate
74  */
75  CVector< C_FLOAT64 > mCalculateResults;
76 
77  /**
78  * A vector of solution variables
79  */
80  CVector< C_FLOAT64 > mSolutionVariables;
81 
82  /**
83  * A vector of solution results
84  */
85  CVector< C_FLOAT64 > mSolutionResults;
86 #endif // XXXX
87 
88  // Operations
89  private:
90  /**
91  * Default constructor
92  */
94 
95  protected:
96  /**
97  * Specific constructor
98  * @param const CCopasiTask::Type & type
99  * @param const CCopasiContainer * pParent (default: NULL)
100  */
101  CCopasiProblem(const CCopasiTask::Type & type,
102  const CCopasiContainer * pParent = NULL);
103 
104  public:
105  /**
106  * Copy constructor
107  * @param const CCopasiProblemr & src
108  * @param const CCopasiContainer * pParent (default: NULL)
109  */
110  CCopasiProblem(const CCopasiProblem & src,
111  const CCopasiContainer * pParent = NULL);
112 
113  /**
114  * Destructor
115  */
116  virtual ~CCopasiProblem();
117 
118  /**
119  * Retrieve the type of the problem
120  * @return const string & type
121  */
122  const CCopasiTask::Type & getType() const;
123 
124  /**
125  * Set the model of the problem
126  * @param CModel * pModel
127  * @result bool succes
128  */
129  virtual bool setModel(CModel * pModel);
130 
131  /**
132  * Retrieve the model of the problem
133  * @result CModel * pModel
134  */
135  CModel * getModel() const;
136 
137  /**
138  * Set the call back of the problem
139  * @param CProcessReport * pCallBack
140  * @result bool succes
141  */
142  virtual bool setCallBack(CProcessReport * pCallBack);
143 
144  /**
145  * Sets the initial value (in case this applies to the specific problem)
146  */
147  //virtual void setInitialState(const CState & initialState);
148 
149  // propably for optimization only
150 
151  /**
152  * Do all neccessary initialization so that calls to caluclate will
153  * be successful. This is called once from CCopasiTask::process()
154  * @result bool succes
155  */
156  virtual bool initialize();
157 
158  /**
159  * Do the calculatting based on CalculateVariables and fill
160  * CalculateResults with the results.
161  * @result bool succes
162  */
163  // virtual bool calculate();
164 
165  /**
166  * Do all neccessary restore procedures so that the
167  * model is in the same state as before
168  * @parem const bool & updateModel
169  * @result bool succes
170  */
171  virtual bool restore(const bool & updateModel);
172 
173  /**
174  * calculate function for optimization
175  * @result bool fullfilled
176  */
177  // virtual bool checkParametricConstraints();
178 
179  /**
180  * calculate function for optimization
181  * @result bool fullfilled
182  */
183  // virtual bool checkFunctionalConstraints();
184 
185  /**
186  * This is the output method for any object. The default implementation
187  * provided with CCopasiObject uses the ostream operator<< of the object
188  * to print the object.To overide this default behaviour one needs to
189  * reimplement the virtual print function.
190  * @param std::ostream * ostream
191  */
192  virtual void print(std::ostream * ostream) const;
193 
194  /**
195  * Output stream operator
196  * @param ostream & os
197  * @param const CCopasiProblem & A
198  * @return ostream & os
199  */
200  friend std::ostream &operator<<(std::ostream &os, const CCopasiProblem & o);
201 
202  /**
203  * This is the output method for any rsult of a problem. The default implementation
204  * provided with CCopasiProblem. Does only print "Not implmented." To overide this
205  * default behaviour one needs to reimplement the virtual printResult function.
206  * @param std::ostream * ostream
207  */
208  virtual void printResult(std::ostream * ostream) const;
209  };
210 
211 #endif // COPASI_CCopasiProblem
virtual void print(std::ostream *ostream) const
CReport * mpReport
virtual bool setModel(CModel *pModel)
CCopasiTask::Type mType
virtual bool restore(const bool &updateModel)
Definition: CModel.h:50
virtual bool setCallBack(CProcessReport *pCallBack)
CModel * mpModel
CProcessReport * mpCallBack
virtual void printResult(std::ostream *ostream) const
const CCopasiTask::Type & getType() const
CModel * getModel() const
friend std::ostream & operator<<(std::ostream &os, const CCopasiProblem &o)
virtual bool initialize()
virtual ~CCopasiProblem()