COPASI API  4.16.103
COptTask.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/COptTask.h,v $
3 // $Revision: 1.11 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 19:31:26 $
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  * COptTask class.
25  *
26  * This class implements a optimization task which is comprised of a
27  * of a problem and a method.
28  *
29  */
30 
31 #ifndef COPASI_COptTask
32 #define COPASI_COptTask
33 
34 #include "utilities/CVector.h"
35 #include "utilities/CCopasiTask.h"
37 
38 class COptProblem;
39 class COptMethod;
40 class CReport;
41 
42 class COptTask : public CCopasiTask
43 {
44  //Attributes
45 
46 public:
47  /**
48  * The methods which can be selected for performing this task.
49  */
50  static const unsigned int ValidMethods[];
51 
52  /**
53  * default constructor
54  * @param const CCopasiTask::Type & type (default: optimization)
55  * @param const CCopasiContainer * pParent (default: NULL)
56  */
58  const CCopasiContainer * pParent = NULL);
59 
60  /**
61  * Copy constructor
62  * @param const COptTask & src
63  */
64  //-COptTask(const COptTask & src);
65  COptTask(const COptTask & src, const CCopasiContainer * pParent = NULL);
66 
67  /**
68  * Destructor
69  */
70  ~COptTask();
71 
72  /**
73  * cleanup()
74  */
75  void cleanup();
76 
77  /**
78  * Set the call back of the task
79  * @param CProcessReport * pCallBack
80  * @result bool success
81  */
82  virtual bool setCallBack(CProcessReport * pCallBack);
83 
84  /**
85  * Initialize the task. If an ostream is given this ostream is used
86  * instead of the target specified in the report. This allows nested
87  * tasks to share the same output device.
88  * @param const OutputFlag & of
89  * @param COutputHandler * pOutputHandler
90  * @param std::ostream * pOstream (default: NULL)
91  * @return bool success
92  */
93  virtual bool initialize(const OutputFlag & of,
94  COutputHandler * pOutputHandler,
95  std::ostream * pOstream);
96 
97  /**
98  * Process the task with or without initializing to the initial state.
99  * @param const bool & useInitialValues
100  * @return bool success
101  */
102  virtual bool process(const bool & useInitialValues);
103 
104  /**
105  * Set the method type applied to solve the task
106  * @param const CCopasiMethod::SubType & type
107  * @return bool success
108  */
109  virtual bool setMethodType(const int & type);
110 
111  /**
112  * Create a method of the specified type to solve the task.
113  * It is the duty of the caller to release the CCopasiMethod.
114  * @param const CCopasiMethod::SubType & type
115  * @return CCopasiMethod *
116  */
117  virtual CCopasiMethod * createMethod(const int & type) const;
118 
119 };
120 #endif // COPASI_COptTask
virtual CCopasiMethod * createMethod(const int &type) const
Definition: COptTask.cpp:171
~COptTask()
Definition: COptTask.cpp:85
static const unsigned int ValidMethods[]
Definition: COptTask.h:50
virtual bool setCallBack(CProcessReport *pCallBack)
Definition: COptTask.cpp:90
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
Definition: COptTask.cpp:101
virtual bool process(const bool &useInitialValues)
Definition: COptTask.cpp:131
virtual bool setMethodType(const int &type)
Definition: COptTask.cpp:156
void cleanup()
Definition: COptTask.cpp:88
COptTask(const CCopasiTask::Type &type=CCopasiTask::optimization, const CCopasiContainer *pParent=NULL)
Definition: COptTask.cpp:63