PaGMO  1.1.5
base_stochastic.h
1 /*****************************************************************************
2  * Copyright (C) 2004-2015 The PaGMO development team, *
3  * Advanced Concepts Team (ACT), European Space Agency (ESA) *
4  * *
5  * https://github.com/esa/pagmo *
6  * *
7  * act@esa.int *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License *
20  * along with this program; if not, write to the *
21  * Free Software Foundation, Inc., *
22  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
23  *****************************************************************************/
24 
25 #ifndef PAGMO_PROBLEM_BASE_STOCHASTIC_H
26 #define PAGMO_PROBLEM_BASE_STOCHASTIC_H
27 
28 #include "base.h"
29 #include "../serialization.h"
30 #include "../rng.h"
31 
32 namespace pagmo{ namespace problem {
33 
35 
56 class __PAGMO_VISIBLE base_stochastic : public base
57 {
58  public:
59  base_stochastic(int, unsigned int = 0u);
60  base_stochastic(int, int, int, int, int, const double&, unsigned int);
61  base_stochastic(int, int, int, int, int, const std::vector<double>&, unsigned int);
62 
63  unsigned int get_seed() const;
64  void set_seed(unsigned int) const; //This is marked const as m_seed is mutable (needs to be)
65  private:
66  friend class boost::serialization::access;
67  template <class Archive>
68  void serialize(Archive &ar, const unsigned int)
69  {
70  ar & boost::serialization::base_object<base>(*this);
71  ar & m_drng;
72  ar & m_urng;
73  ar & m_seed;
74  }
75 
76  protected:
78  mutable rng_double m_drng;
80  mutable rng_uint32 m_urng;
82  mutable unsigned int m_seed;
83 
84 };
85 
86 }} //namespaces
87 
88 BOOST_SERIALIZATION_ASSUME_ABSTRACT(pagmo::problem::base_stochastic)
89 
90 #endif // PAGMO_PROBLEM_BASE_STOCHASTIC_H
Root PaGMO namespace.
This rng returns an unsigned integer in the [0,2**32-1] range.
Definition: rng.h:47
rng_uint32 m_urng
Random number generator for unsigned integer values.
Base problem class.
Definition: problem/base.h:148
rng_double m_drng
Random number generator for double-precision floating point values.
unsigned int m_seed
Seed of the random number generator.
Base Stochastic Optimization Problem.
This rng returns a double in the [0,1[ range.
Definition: rng.h:89