COPASI API  4.16.103
CTrajectoryMethod.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/trajectory/CTrajectoryMethod.h,v $
3  $Revision: 1.27 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2011/03/07 19:34:13 $
7  End CVS Header */
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
20 // Properties, Inc. and EML Research, gGmbH.
21 // All rights reserved.
22 
23 /**
24  * CTrajectoryMethod class.
25  * This class describes the interface to all integration methods.
26  * The various method like LSODA or Gillespie have to be derived from
27  * this class.
28  *
29  * Created for COPASI by Stefan Hoops 2002
30  */
31 
32 #ifndef COPASI_CTrajectoryMethod
33 #define COPASI_CTrajectoryMethod
34 
35 #include <string>
36 
39 
40 class CTrajectoryProblem;
41 class CState;
42 
44 {
45 public:
46  /**
47  * Enumeration value for the return value
48  */
49  enum Status
50  {
51  FAILURE = -1,
52  NORMAL = 0,
53  ROOT = 1
54  };
55 
56 protected:
57  /**
58  * A pointer to the current state. This is set from outside
59  * with the setState() method and never changed anywhere else.
60  * It's used to report the results
61  * to the calling TrajectoryTask
62  */
64 
65  /**
66  * A pointer to the trajectory problem.
67  */
69 
70  /**
71  * Vector containing information on the current roots
72  */
74 
75  // Operations
76 private:
77  /**
78  * Default constructor.
79  */
81 
82 protected:
83  /**
84  * Default constructor.
85  * @param const CCopasiMethod::SubType & subType
86  * @param const CCopasiContainer * pParent (default: NULL)
87  */
89  const CCopasiContainer * pParent = NULL);
90 
91 public:
92  /**
93  * Create a trajectory method for a special problem.
94  * Note: the returned object has to be released after use with delete
95  * a problem is also passed so that the method has a chance to choose an
96  * appropriate simulation method.
97  */
98  static CTrajectoryMethod *
100 
101  /**
102  * Copy constructor.
103  * @param "const CTrajectoryMethod &" src
104  * @param const CCopasiContainer * pParent (default: NULL)
105  */
107  const CCopasiContainer * pParent = NULL);
108 
109  /**
110  * Destructor.
111  */
113 
114  /**
115  * Set a pointer to the current state.
116  * This method is used by CTrajectoryTask::process()
117  * The results of the simulation are passed via this CState variable
118  * @param "CState *" currentState
119  */
120  void setCurrentState(CState * currentState);
121 
122  /**
123  * Set a pointer to the problem.
124  * This method is used by CTrajectory
125  * @param "CTrajectoryProblem *" problem
126  */
127  void setProblem(CTrajectoryProblem * problem);
128 
129  /**
130  * Inform the trajectory method that the state has changed outside
131  * its control
132  */
133  virtual void stateChanged();
134 
135  /**
136  * This instructs the method to calculate a time step of deltaT
137  * starting with the current state, i.e., the result of the previous
138  * step.
139  * The new state (after deltaT) is expected in the current state.
140  * The return value is the actual timestep taken.
141  * @param "const double &" deltaT
142  * @return Status status
143  */
144  virtual Status step(const double & deltaT);
145 
146  /**
147  * This instructs the method to prepare for integration
148  * starting with the initialState given.
149  * @param "const CState *" initialState
150  */
151  virtual void start(const CState * initialState);
152 
153  /**
154  * Retrieve the roots.
155  * @return const CVector< C_INT > & roots
156  */
157  const CVector< C_INT > & getRoots() const;
158 
159  /**
160  * Check if the method is suitable for this problem
161  * @return bool suitability of the method
162  */
163  virtual bool isValidProblem(const CCopasiProblem * pProblem);
164 };
165 
166 #endif // COPASI_CTrajectoryMethod
void setProblem(CTrajectoryProblem *problem)
virtual void stateChanged()
Definition: CState.h:305
CTrajectoryProblem * mpProblem
void setCurrentState(CState *currentState)
virtual bool isValidProblem(const CCopasiProblem *pProblem)
const CVector< C_INT > & getRoots() const
CVector< C_INT > mRoots
virtual void start(const CState *initialState)
static CTrajectoryMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::deterministic)
virtual Status step(const double &deltaT)