COPASI API  4.16.103
CRandomSearch.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/CRandomSearch.h,v $
3  $Revision: 1.13 $
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  * CRandomSearch class
20  */
21 
22 #ifndef COPASI_CRandomSearch
23 #define COPASI_CRandomSearch
24 
25 //class CRandom;
26 //*** need to be added for definition
27 class COptProblem;
28 class COptMethod;
29 
31 #include "utilities/CVector.h"
32 
33 // YOHE: this is an abstract class that contains many virtual functions
34 // without definitions
35 //
36 /** @dia:pos 48.05,34.05 */
37 /** @dia:route COptMethod; v,46.9608,16.35,33,59.1652,34.05 */
38 class CRandomSearch : public COptMethod
39 {
41 
42  // Operations
43 private:
44  /**
45  * Default Constructor
46  */
47  CRandomSearch();
48 
49  /**
50  * Initialize arrays and pointer.
51  * @return bool success
52  */
53  virtual bool initialize();
54 
55  /**
56  * Initialize contained objects.
57  */
58  void initObjects();
59 
60  /**
61  * Evaluate the fitness of one individual
62  * @param const CVector< C_FLOAT64 > & individual
63  * @return bool continue
64  */
65  bool evaluate(const CVector< C_FLOAT64 > & individual);
66 
67  /**
68  * Find the best individual at this generation
69  * @return size_t fittest
70  */
71  size_t fittest();
72 
73  /**
74  * number of iterations
75  */
76  unsigned C_INT32 mIterations;
77 
78  /**
79  * The current iteration
80  */
81  unsigned C_INT32 mCurrentIteration;
82 
83  /**
84  * a vector of the number of individuals.
85  */
87 
88  /**
89  * array of values of objective function f/ individuals
90  */
92 
93  /**
94  * a pointer to the randomnumber generator.
95  */
96  CRandom * mpRandom;
97 
98  /**
99  * *** Perhaps this is actually not needed ****number of parameters
100  */
101  size_t mVariableSize;
102 
103  /**
104  * The best value found so far.
105  */
107 
108 public:
109  /**
110  * Copy Constructor
111  * @param const CRandomSearch & src
112  */
113  CRandomSearch(const CRandomSearch & src);
114 
115  /**
116  * Destructor
117  */
118  virtual ~CRandomSearch();
119 
120  /**
121  * Execute the optimization algorithm calling simulation routine
122  * when needed. It is noted that this procedure can give feedback
123  * of its progress by the callback function set with SetCallback.
124  */
125  virtual bool optimise();
126 };
127 
128 #endif // COPASI_CRandomSearch
CVector< C_FLOAT64 > mIndividual
Definition: CRandomSearch.h:84
virtual bool optimise()
static COptMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::RandomSearch)
Definition: COptMethod.cpp:50
#define C_INT32
Definition: copasi.h:90
unsigned C_INT32 mCurrentIteration
Definition: CRandomSearch.h:79
size_t mVariableSize
Definition: CRandomSearch.h:99
CRandom * mpRandom
Definition: CRandomSearch.h:94
virtual bool initialize()
size_t fittest()
C_FLOAT64 mValue
Definition: CRandomSearch.h:89
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 mBestValue
virtual ~CRandomSearch()
unsigned C_INT32 mIterations
Definition: CRandomSearch.h:74
bool evaluate(const CVector< C_FLOAT64 > &individual)