COPASI API  4.16.103
CTSSATask.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/tssanalysis/CTSSATask.h,v $
3 // $Revision: 1.7 $
4 // $Name: $
5 // $Author: nsimus $
6 // $Date: 2012/06/04 11:06:09 $
7 // End CVS Header
8 
9 // Copyright (C) 2012 - 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  * CTSSATask class.
25  *
26  * This class implements a time scale separation analysis task which is comprised of a
27  * of a problem and a method. Additionally calls to the reporting
28  * methods are done when initialized.
29  *
30  */
31 
32 #ifndef COPASI_CTSSATask
33 #define COPASI_CTSSATask
34 
36 #include "utilities/CCopasiTask.h"
37 #include "trajectory/CTimeSeries.h"
38 
39 class CTSSAProblem;
40 class CTSSAMethod;
41 class CState;
42 
43 class CTSSATask : public CCopasiTask
44 {
45  //Attributes
46 public:
47  /**
48  * The methods which can be selected for performing this task.
49  */
50  static const unsigned int ValidMethods[];
51 
52 private:
53 
54  /**
55  * whether the time series should be stored in mTimeSeries
56  */
58 
59  /**
60  * the time series (if requested)
61  */
63 
64  /**
65  * A pointer to the Problem
66  */
68 
69  /**
70  * A pointer to the method
71  */
73 
74  /**
75  * Indicates whether we need to update moieties.
76  */
78 
79  /**
80  * A pointer to the current state of the integration.
81  */
83 
84  /**
85  * A pointer to the current time of the integration.
86  */
88 
89 public:
90  /**
91  * Default constructor
92  * @param const CCopasiContainer * pParent (default: NULL)
93  */
94  CTSSATask(const CCopasiContainer * pParent = NULL);
95 
96  /**
97  * Copy constructor
98  * @param const CTSSATask & src
99  * @param const CCopasiContainer * pParent (default: NULL)
100  */
101  CTSSATask(const CTSSATask & src,
102  const CCopasiContainer * pParent = NULL);
103 
104  /**
105  * Destructor
106  */
107  ~CTSSATask();
108 
109  /**
110  * Resizes result matrices and updates array annotations for a specific task.
111  * This is used when we need to know about the data structures of a task result
112  * without actually performing the task, e.g. when selecting objects for output.
113  * For now we assume that this functionality is also performed when
114  * initialize() is called.
115  */
116  virtual bool updateMatrices();
117 
118  /**
119  * Initialize the task. If an ostream is given this ostream is used
120  * instead of the target specified in the report. This allows nested
121  * tasks to share the same output device.
122  * @param const OutputFlag & of
123  * @param COutputHandler * pOutputHandler
124  * @param std::ostream * pOstream (default: NULL)
125  * @return bool success
126  */
127  virtual bool initialize(const OutputFlag & of,
128  COutputHandler * pOutputHandler,
129  std::ostream * pOstream);
130 
131  /**
132  * Process the task with or without initializing to the initial state.
133  * @param const bool & useInitialValues
134  * @return bool success
135  */
136  virtual bool process(const bool & useInitialValues);
137 
138  /**
139  * Starts the process of integration by calling CTSSAMethod::start
140  * @param const bool & useInitialValues
141  */
142  void processStart(const bool & useInitialValues);
143 
144  /**
145  * Integrates one step
146  * @param const C_FLOAT64 & nextTime
147  * @return bool success;
148  */
149  bool processStep(const C_FLOAT64 & nextTime);
150 
151  /**
152  * Perform necessary cleanup procedures
153  */
154  virtual bool restore();
155 
156  /**
157  * Set the method type applied to solve the task
158  * @param const CCopasiMethod::SubType & type
159  * @return bool success
160  */
161  virtual bool setMethodType(const int & type);
162 
163  /**
164  * Create a method of the specified type to solve the task.
165  * It is the duty of the caller to release the CCopasiMethod.
166  * @param const CCopasiMethod::SubType & type
167  * @return CCopasiMethod *
168  */
169  virtual CCopasiMethod * createMethod(const int & type) const;
170 
171  /**
172  * Retrieves a pointer to current state of the integration.
173  * @return CState * pState
174  */
175  CState * getState();
176 
177  /**
178  * gets a reference to the time series
179  * @return time series
180  */
181  const CTimeSeries & getTimeSeries() const;
182 
183 private:
184  /**
185  * cleanup()
186  */
187  void cleanup();
188 };
189 #endif // COPASI_CTSSATask
CTSSAMethod * mpTSSAMethod
Definition: CTSSATask.h:72
const C_FLOAT64 * mpCurrentTime
Definition: CTSSATask.h:87
const CTimeSeries & getTimeSeries() const
Definition: CTSSATask.cpp:428
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
Definition: CTSSATask.cpp:138
CTSSAProblem * mpTSSAProblem
Definition: CTSSATask.h:67
Definition: CState.h:305
virtual bool updateMatrices()
Definition: CTSSATask.cpp:119
virtual bool restore()
Definition: CTSSATask.cpp:384
CState * mpCurrentState
Definition: CTSSATask.h:82
virtual bool setMethodType(const int &type)
Definition: CTSSATask.cpp:401
CTSSATask(const CCopasiContainer *pParent=NULL)
Definition: CTSSATask.cpp:61
void cleanup()
Definition: CTSSATask.cpp:114
CTimeSeries mTimeSeries
Definition: CTSSATask.h:62
static const unsigned int ValidMethods[]
Definition: CTSSATask.h:50
bool mUpdateMoieties
Definition: CTSSATask.h:77
virtual bool process(const bool &useInitialValues)
Definition: CTSSATask.cpp:194
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CTSSATask.cpp:418
#define C_FLOAT64
Definition: copasi.h:92
void processStart(const bool &useInitialValues)
Definition: CTSSATask.cpp:319
CState * getState()
Definition: CTSSATask.cpp:425
bool processStep(const C_FLOAT64 &nextTime)
Definition: CTSSATask.cpp:332
bool mTimeSeriesRequested
Definition: CTSSATask.h:57