COPASI API  4.16.103
COptMethod.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/COptMethod.h,v $
3  $Revision: 1.26 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2006/05/02 19:30:19 $
7  End CVS Header */
8 
9 // Copyright 2005 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc. and EML Research, gGmbH.
11 // All rights reserved.
12 
13 /**
14  * File name: COptMethod.h
15  *
16  * Programmer: Yongqun He
17  * Contact email: yohe@vt.edu
18  * Purpose: This is the interface (.h file) of the COptMethod class.
19  * It contains the designed abstract interaction between a simulation
20  * subsystem and optimization algorithms. This base class defines
21  * methods by which the simulation subsystem accesses several
22  * optimization algorithms.
23  * Note: This is an abstract class
24 
25 
26 
27 
28  ****** Modified by Liang Xu
29  */
30 
31 #ifndef COPASI_COptMethod
32 #define COPASI_COptMethod
33 
34 #include <string>
35 
37 
38 class COptProblem;
39 class COptItem;
40 class COptTask;
41 template < class CType > class CVector;
42 
43 // YOHE: this is an abstract class that contains many virtual functions
44 // without definitions
45 //
46 /** @dia:pos 36.4,4.15 */
47 class COptMethod : public CCopasiMethod
48  {
49  public:
50  // static const std::string TypeName[];
51 
52  // Attributes
53  public:
54 
55  //data member
56  protected:
57  /** @dia:route 0,2; h,36.4,4.15,33.95,4.15,23.0576 */
58  COptProblem * mpOptProblem; // pointer to remote problem
59 
61 
62  const bool mBounds; // True if method accepts bounds on the parameters
63 
64  /**
65  * A vector of pointers to the update methods for the optimization parameters
66  */
67  const std::vector< UpdateMethod * > * mpSetCalculateVariable;
68 
69  /**
70  * A vector of pointers to the optimization parameter
71  */
72  const std::vector< COptItem * > * mpOptItem;
73 
74  /**
75  * A vector of pointers to the functional constraints
76  */
77  const std::vector< COptItem * > * mpOptContraints;
78 
79  // Operations
80  private:
81  /**
82  * Default constructor.
83  */
84  COptMethod();
85 
86  protected:
87  /**
88  * Specific constructor
89  * @param const CCopasiTask::Type & type
90  * @param const CCopasiMethod::SubType & subType
91  * @param const CCopasiContainer * pParent (default: NULL)
92  */
93  COptMethod(const CCopasiTask::Type & taskType,
94  const SubType & subType,
95  const CCopasiContainer * pParent = NULL);
96 
97  public:
98  /**
99  * Create a optimization method.
100  * Note: the returned object has to be released after use with delete
101  */
104 
105  /**
106  * Copy constructor
107  * @param const COptMethod & src
108  * @param const CCopasiContainer * pParent (default: NULL)
109  */
110  COptMethod(const COptMethod & src,
111  const CCopasiContainer * pParent = NULL);
112 
113  /**
114  * Destructor
115  */
116  virtual ~COptMethod();
117 
118  /**
119  * Execute the optimization algorithm calling simulation routine
120  * when needed. It is noted that this procedure can give feedback
121  * of its progress by the callback function set with SetCallback.
122  * @ return success;
123  */
124  virtual bool optimise();
125 
126  /**
127  * Returns True if this method is capable of handling adjustable parameter
128  * boundary constraints, False otherwise
129  */
130  bool isBounded(void);
131 
132  /**
133  * Set the problem to be optmised
134  * @param "COptProblem *" problem
135  */
136  void setProblem(COptProblem * problem);
137 
138  /**
139  * Initialize arrays and pointer.
140  * @return bool success
141  */
142  virtual bool initialize();
143 
144  /**
145  * Check if the method is suitable for this problem
146  * @return bool suitability of the method
147  */
148  virtual bool isValidProblem(const CCopasiProblem * pProblem);
149 
150  protected:
151  /**
152  * Cleanup arrays and pointers.
153  * @return bool success
154  */
155  virtual bool cleanup();
156  };
157 
158 #endif // COPASI_COptMethod
virtual bool isValidProblem(const CCopasiProblem *pProblem)
Definition: COptMethod.cpp:219
COptTask * mpParentTask
Definition: COptMethod.h:58
virtual bool initialize()
Definition: COptMethod.cpp:189
virtual ~COptMethod()
Definition: COptMethod.cpp:167
void setProblem(COptProblem *problem)
Definition: COptMethod.cpp:170
static COptMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::RandomSearch)
Definition: COptMethod.cpp:50
COptProblem * mpOptProblem
Definition: COptMethod.h:56
const std::vector< COptItem * > * mpOptContraints
Definition: COptMethod.h:75
const bool mBounds
Definition: COptMethod.h:60
bool isBounded(void)
Definition: COptMethod.cpp:178
virtual bool cleanup()
Definition: COptMethod.cpp:215
const std::vector< UpdateMethod * > * mpSetCalculateVariable
Definition: COptMethod.h:65
virtual bool optimise()
Definition: COptMethod.cpp:184
const std::vector< COptItem * > * mpOptItem
Definition: COptMethod.h:70