COPASI API  4.16.103
COptMethodSA.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/COptMethodSA.h,v $
3  $Revision: 1.8 $
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) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 /**
19  * COptMethodSA class
20  */
21 
22 #ifndef COPASI_COptMethodSA
23 #define COPASI_COptMethodSA
24 
25 #include <vector>
26 #include "utilities/CMatrix.h"
28 
29 class CRandom;
30 
31 class COptMethodSA : public COptMethod
32 {
34 
35  // Operations
36 public:
37  /**
38  * Copy Constructor
39  * @param const COptMethodSA & src
40  * @param const CCopasiContainer * pParent (default: NULL)
41  */
42  COptMethodSA(const COptMethodSA & src,
43  const CCopasiContainer * pParent = NULL);
44 
45  /**
46  * Destructor
47  */
48  virtual ~COptMethodSA();
49 
50  /**
51  * Execute the optimization algorithm calling simulation routine
52  * when needed. It is noted that this procedure can give feedback
53  * of its progress by the callback function set with SetCallback.
54  * @ return success;
55  */
56  virtual bool optimise();
57 
58 private:
59  /**
60  * Default Constructor
61  * @param const CCopasiContainer * pParent (default: NULL)
62  */
63  COptMethodSA(const CCopasiContainer * pParent = NULL);
64 
65  /**
66  * Initialize contained objects.
67  */
68  void initObjects();
69 
70  /**
71  * Initialize arrays and pointer.
72  * @return bool success
73  */
74  virtual bool initialize();
75 
76  /**
77  * Cleanup arrays and pointers.
78  * @return bool success
79  */
80  virtual bool cleanup();
81 
82  /**
83  * Evaluate the objective function
84  * @return bool continue
85  */
86  const C_FLOAT64 & evaluate();
87 
88  // Attributes
89 private:
90 
91  /**
92  * The current temperature
93  */
95 
96  /**
97  * Handle to the process report item "Current Temperature"
98  */
99  size_t mhTemperature;
100 
101  /**
102  * The cooling factor
103  */
105 
106  /**
107  * The tolerance
108  */
110 
111  /**
112  * a pointer to the randomnumber generator.
113  */
115 
116  /**
117  * number of parameters
118  */
120 
121  /**
122  * The best value found so far
123  */
125 
126  /**
127  * The result of a function evaluation
128  */
130 
131  /**
132  * Flag indicating whether the computation shall continue
133  */
134  bool mContinue;
135 
136  /**
137  * The current solution guess
138  */
140 
141  /**
142  * The result of a function evaluation for mCurrent
143  */
145 
146  /**
147  * The step taken
148  */
150 
151  /**
152  * The number of accepted steps
153  */
155 };
156 
157 #endif // COPASI_COptMethodSA
C_FLOAT64 mTolerance
Definition: COptMethodSA.h:109
COptMethodSA(const COptMethodSA &src, const CCopasiContainer *pParent=NULL)
virtual bool cleanup()
CVector< C_FLOAT64 > mCurrent
Definition: COptMethodSA.h:139
static COptMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::RandomSearch)
Definition: COptMethod.cpp:50
virtual bool initialize()
size_t mVariableSize
Definition: COptMethodSA.h:119
C_FLOAT64 mCoolingFactor
Definition: COptMethodSA.h:104
C_FLOAT64 mTemperature
Definition: COptMethodSA.h:94
CVector< size_t > mAccepted
Definition: COptMethodSA.h:154
CVector< C_FLOAT64 > mStep
Definition: COptMethodSA.h:149
size_t mhTemperature
Definition: COptMethodSA.h:99
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 mCurrentValue
Definition: COptMethodSA.h:144
C_FLOAT64 mEvaluationValue
Definition: COptMethodSA.h:129
const C_FLOAT64 & evaluate()
void initObjects()
virtual ~COptMethodSA()
virtual bool optimise()
C_FLOAT64 mBestValue
Definition: COptMethodSA.h:124
CRandom * mpRandom
Definition: COptMethodSA.h:114