PaGMO  1.1.5
Public Types | Public Member Functions | Protected Member Functions | Friends
pagmo::problem::noisy Class Reference

Noisy meta-problem. More...

#include <noisy.h>

Inheritance diagram for pagmo::problem::noisy:
Inheritance graph
[legend]

Public Types

enum  noise_type { NORMAL = 0, UNIFORM = 1 }
 Distribution type of the noise. More...
 
- Public Types inherited from pagmo::problem::base
typedef decision_vector::size_type size_type
 Problem's size type: the same as pagmo::decision_vector's size type.
 
typedef fitness_vector::size_type f_size_type
 Fitness' size type: the same as pagmo::fitness_vector's size type.
 
typedef constraint_vector::size_type c_size_type
 Constraints' size type: the same as pagmo::constraint_vector's size type.
 

Public Member Functions

 noisy (const base &=ackley(1), unsigned int trials=1, const double param_first=0.0, const double param_second=0.1, noise_type=NORMAL, unsigned int seed=0u)
 
 noisy (const noisy &)
 Copy Constructor. Performs a deep copy.
 
base_ptr clone () const
 Clone method.
 
std::string get_name () const
 Get problem's name. More...
 
void set_noise_param (double, double)
 
double get_param_first () const
 
double get_param_second () const
 
- Public Member Functions inherited from pagmo::problem::base_stochastic
 base_stochastic (int, unsigned int=0u)
 Constructor from global dimension and random seed. More...
 
 base_stochastic (int, int, int, int, int, const double &, unsigned int)
 Constructor from global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
 base_stochastic (int, int, int, int, int, const std::vector< double > &, unsigned int)
 Constructor from global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance vector. More...
 
unsigned int get_seed () const
 Gets the pseudo random generator seed. More...
 
void set_seed (unsigned int) const
 Sets the pseudo random generator seed. More...
 
- Public Member Functions inherited from pagmo::problem::base
 base (int, int=0, int=1, int=0, int=0, const double &=0)
 Constructor from global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
 base (int, int, int, int, int, const std::vector< double > &)
 Constructor from global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
 base (const double &, const double &, int, int=0, int=1, int=0, int=0, const double &=0)
 Constructor from values for lower and upper bounds, global dimension, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
 base (const decision_vector &, const decision_vector &, int=0, int=1, int=0, int=0, const double &=0)
 Constructor from upper/lower bounds, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
template<std::size_t N>
 base (const double(&v1)[N], const double(&v2)[N], int ni=0, int nf=1, int nc=0, int nic=0, const double &c_tol=0)
 Constructor from raw arrays, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
template<class Iterator1 , class Iterator2 >
 base (Iterator1 start1, Iterator1 end1, Iterator2 start2, Iterator2 end2, int ni=0, int nf=1, int nc=0, int nic=0, const double &c_tol=0)
 Constructor from iterators, integer dimension, fitness dimension, global constraints dimension, inequality constraints dimension and constraints tolerance. More...
 
virtual ~base ()
 Trivial destructor. More...
 
std::string human_readable () const
 Return human readable representation of the problem. More...
 
bool operator== (const base &) const
 Equality operator. More...
 
bool operator!= (const base &) const
 Inequality operator. More...
 
bool is_compatible (const base &) const
 Compatibility operator. More...
 
bool compare_x (const decision_vector &, const decision_vector &) const
 Compare decision vectors. More...
 
bool verify_x (const decision_vector &) const
 Verify compatibility of decision vector x with problem. More...
 
bool compare_fc (const fitness_vector &, const constraint_vector &, const fitness_vector &, const constraint_vector &) const
 Simultaneous fitness-constraint comparison. More...
 
virtual void pre_evolution (population &) const
 Pre-evolution hook. More...
 
virtual void post_evolution (population &) const
 Post-evolution hook. More...
 
virtual void set_sparsity (int &lenG, std::vector< int > &iGfun, std::vector< int > &jGvar) const
 Sets the sparsity pattern of the gradient. More...
 
const decision_vectorget_lb () const
 Lower bounds getter. More...
 
const decision_vectorget_ub () const
 Upper bounds getter. More...
 
void set_bounds (const decision_vector &, const decision_vector &)
 Bounds setter from pagmo::decision_vector. More...
 
template<class Iterator1 , class Iterator2 >
void set_bounds (Iterator1 start1, Iterator1 end1, Iterator2 start2, Iterator2 end2)
 Bounds setter from iterators. More...
 
template<std::size_t N>
void set_bounds (const double(&v1)[N], const double(&v2)[N])
 Bounds setter from raw arrays. More...
 
void set_bounds (const double &, const double &)
 Set bounds to specified values. More...
 
void set_bounds (int, const double &, const double &)
 Set bounds to specified values. More...
 
void set_lb (const decision_vector &)
 Set lower bounds from pagmo::decision_vector. More...
 
void set_lb (int, const double &)
 Set specific lower bound to value. More...
 
void set_lb (const double &)
 Set all lower bounds to value. More...
 
template<class Iterator >
void set_lb (Iterator start, Iterator end)
 Lower bounds setter from iterators. More...
 
template<std::size_t N>
void set_lb (const double(&v)[N])
 Lower bounds setter from raw array. More...
 
void set_ub (const decision_vector &)
 Set upper bounds from pagmo::decision_vector. More...
 
void set_ub (int, const double &)
 Set specific upper bound to value. More...
 
void set_ub (const double &)
 Set all upper bounds to value. More...
 
template<class Iterator >
void set_ub (Iterator start, Iterator end)
 Upper bounds setter from iterators. More...
 
template<std::size_t N>
void set_ub (const double(&v)[N])
 Upper bounds setter from raw array. More...
 
unsigned int get_fevals () const
 Return number of function evaluations. More...
 
unsigned int get_cevals () const
 Return number of constraints function evaluations. More...
 
size_type get_dimension () const
 Return global dimension. More...
 
size_type get_i_dimension () const
 Return integer dimension. More...
 
f_size_type get_f_dimension () const
 Return fitness dimension. More...
 
c_size_type get_c_dimension () const
 Return global constraints dimension. More...
 
c_size_type get_ic_dimension () const
 Return inequality constraints dimension. More...
 
const std::vector< double > & get_c_tol () const
 Return constraints tolerance. More...
 
double get_diameter () const
 Get the diameter of the problem. More...
 
constraint_vector compute_constraints (const decision_vector &) const
 Compute constraints and return constraint vector. More...
 
void compute_constraints (constraint_vector &, const decision_vector &) const
 Compute constraints and write them into contraint vector. More...
 
bool compare_constraints (const constraint_vector &, const constraint_vector &) const
 Compare constraint vectors. More...
 
bool test_constraint (const constraint_vector &, const c_size_type &) const
 Test i-th constraint of c (using tolerance information). More...
 
bool feasibility_x (const decision_vector &) const
 Test feasibility of decision vector. More...
 
bool feasibility_c (const constraint_vector &) const
 Test feasibility of constraint vector. More...
 
fitness_vector objfun (const decision_vector &) const
 Return fitness of pagmo::decision_vector. More...
 
void objfun (fitness_vector &, const decision_vector &) const
 Write fitness of pagmo::decision_vector into pagmo::fitness_vector. More...
 
bool compare_fitness (const fitness_vector &, const fitness_vector &) const
 Compare fitness vectors. More...
 
void reset_caches () const
 Reset internal caches. More...
 
const std::vector< constraint_vector > & get_best_c (void) const
 Get the best known constraint vector. More...
 
const std::vector< decision_vector > & get_best_x (void) const
 Get the best known decision vector. More...
 
const std::vector< fitness_vector > & get_best_f (void) const
 Get the best known fitness vector. More...
 
void set_best_x (const std::vector< decision_vector > &)
 Sets the best known decision vectors. More...
 

Protected Member Functions

std::string human_readable_extra () const
 Extra human readable info for the problem. More...
 
void objfun_impl (fitness_vector &, const decision_vector &) const
 
void compute_constraints_impl (constraint_vector &, const decision_vector &) const
 
- Protected Member Functions inherited from pagmo::problem::base
virtual bool equality_operator_extra (const base &) const
 Extra requirements for equality. More...
 
virtual bool compare_fc_impl (const fitness_vector &, const constraint_vector &, const fitness_vector &, const constraint_vector &) const
 Implementation of simultaneous fitness-constraint comparison. More...
 
void estimate_sparsity (const decision_vector &, int &lenG, std::vector< int > &iGfun, std::vector< int > &jGvar) const
 Heuristics to estimate the sparsity pattern of the problem. More...
 
void estimate_sparsity (int &lenG, std::vector< int > &iGfun, std::vector< int > &jGvar) const
 Heuristics to estimate the sparsity pattern of the problem. More...
 
virtual bool compare_constraints_impl (const constraint_vector &, const constraint_vector &) const
 Implementation of constraint vector comparison. More...
 
virtual bool compare_fitness_impl (const fitness_vector &, const fitness_vector &) const
 Implementation of fitness vectors comparison. More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Attributes inherited from pagmo::problem::base
static const std::size_t cache_capacity = 5
 Capacity of the internal caches.
 
- Protected Attributes inherited from pagmo::problem::base_stochastic
rng_double m_drng
 Random number generator for double-precision floating point values.
 
rng_uint32 m_urng
 Random number generator for unsigned integer values.
 
unsigned int m_seed
 Seed of the random number generator.
 

Detailed Description

Noisy meta-problem.

A meta-problem that transforms a problem into its stochastic version by injecting noises to the fitness vector (and constraint vector) with either uniform or gaussian distribution. The resulting value is then averaged upon m_trials as to rbe able to reproduce a typical set-up in Evolutionary Robotics, but aso in stochastic optimization

NOTE: for m_trials->infinity one recovers a deterministic problem, but the objective function computation soon becomes very expensive. The trade-off is to keep m_trials small, while being able to get good convergence.

Author
Yung-Siang Liau (liauy.nosp@m.s@gm.nosp@m.ail.c.nosp@m.om)
Dario Izzo (dario.nosp@m..izz.nosp@m.o@gma.nosp@m.il.c.nosp@m.om)

Definition at line 55 of file noisy.h.

Member Enumeration Documentation

Distribution type of the noise.

Enumerator
NORMAL 

Normal distribution.

UNIFORM 

Uniform distribution.

Definition at line 59 of file noisy.h.

Constructor & Destructor Documentation

pagmo::problem::noisy::noisy ( const base p = ackley(1),
unsigned int  trials = 1,
const double  param_first = 0.0,
const double  param_second = 0.1,
noise_type  distribution = NORMAL,
unsigned int  seed = 0u 
)

Construct by specifying a problem to be transformed and the noise distribution, controlled by a flag and two params. Currently two types of noise distribution are supported, namely the normally distributed noise (NORMAL) and uniformly distributed noise (UNIFORM).

Parameters
[in]ppagmo::problem::base to be noisy
[in]trialsnumber of samples to average upon
[in]param_firstMean of the Gaussian noise / Lower bound of the uniform noise
[in]param_secondStandard deviation of the Gaussian noise / Upper bound of the uniform noise
[in]distributionTwo types of distributions for the noise are currently supported: NORMAL or UNIFORM
[in]seedseed for the underlying rng
See also
problem::base_stochastic constructors.

Definition at line 54 of file noisy.cpp.

Member Function Documentation

void pagmo::problem::noisy::compute_constraints_impl ( constraint_vector c,
const decision_vector x 
) const
protectedvirtual

Implementation of the constraints computation. Add noises to the computed constraint vector.

Reimplemented from pagmo::problem::base.

Definition at line 150 of file noisy.cpp.

std::string pagmo::problem::noisy::get_name ( ) const
virtual

Get problem's name.

Default implementation will return the problem's mangled C++ name.

Returns
name of the problem.

Reimplemented from pagmo::problem::base.

Definition at line 194 of file noisy.cpp.

double pagmo::problem::noisy::get_param_first ( ) const

Returns the first parameter. Interpretation depends on the noise specified, see constructor.

Definition at line 114 of file noisy.cpp.

double pagmo::problem::noisy::get_param_second ( ) const

Return the second parameter. Interpretation depends on the noise specified, see constructor.

Definition at line 123 of file noisy.cpp.

std::string pagmo::problem::noisy::human_readable_extra ( ) const
protectedvirtual

Extra human readable info for the problem.

Will return a formatted string containing the translation vector

Reimplemented from pagmo::problem::base.

Definition at line 203 of file noisy.cpp.

void pagmo::problem::noisy::objfun_impl ( fitness_vector f,
const decision_vector x 
) const
protectedvirtual

Implementation of the objective function. Add noises to the computed fitness vector.

Implements pagmo::problem::base.

Definition at line 130 of file noisy.cpp.

void pagmo::problem::noisy::set_noise_param ( double  param_first,
double  param_second 
)

Configure parameters for the noise distribution

param[in] param_first Mean of the Gaussian noise / Lower bound of the uniform noise param[in] param_second Standard deviation of the Gaussian noise / Upper bound of the uniform noise

Definition at line 101 of file noisy.cpp.


The documentation for this class was generated from the following files: