OPTK  0.1.2
Toolkit for global optimisation algorithms
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
syn::synthetic Class Reference

#include <synthetic.hpp>

Inheritance diagram for syn::synthetic:
optk::benchmark syn::ackley1 syn::ackley2 syn::ackley3 syn::bartels_conn syn::beale syn::biggs_exp2 syn::biggs_exp3 syn::biggs_exp4 syn::biggs_exp5 syn::biggs_exp6 syn::bird syn::bohachevsky1 syn::bohachevsky2 syn::bohachevsky3 syn::booth syn::box_betts syn::branin1 syn::branin2 syn::brent syn::brown syn::bukin2 syn::bukin4 syn::bukin6 syn::chung_reynolds syn::cola syn::colville syn::corana syn::cosine_mixture syn::cosine_mixture2 syn::cross_in_tray syn::csendes syn::cube syn::damavandi syn::deckkers_aarts syn::deflected_corrugated_spring syn::devillers_glasser1 syn::devillers_glasser2 syn::dixon_price syn::dolan syn::drop_wave syn::easom syn::egg_crate syn::egg_holder syn::el_attar_vidyasagar_dutta syn::exp2 syn::exponential syn::franke syn::freudenstein_roth syn::gear syn::giunta syn::goldstein_price syn::griewank syn::gulf syn::hansen syn::hartman3 syn::hartman6 syn::helical_valley syn::himmelblau syn::holder_table syn::hosaki syn::jennrich_sampson syn::keane syn::langermann2 syn::langermann5 syn::lennard_jones syn::leon syn::levy13 syn::levy3 syn::levy5 syn::manifoldmin syn::matyas syn::mccormick syn::michalewicz02 syn::michalewicz06 syn::michalewicz12 syn::miele_cantrell syn::mishra01 syn::mishra02 syn::mishra03 syn::mishra04 syn::mishra05 syn::mishra06 syn::mishra08 syn::mishra09 syn::mishra11 syn::mog01 syn::regression

Public Member Functions

 synthetic (const std::string &n, u_int dims, double lb, double ub, double opt)
 
 synthetic (const std::string &n, u_int dims, double opt)
 
 ~synthetic ()
 
sspace::sspace_tget_search_space ()
 
void set_properties (std::vector< properties > p)
 
std::vector< propertiesget_properties ()
 
inst::set get_opt_param ()
 
double get_opt ()
 
void update_opt (double opt)
 
u_int get_dims ()
 
void validate_param_set (inst::set x)
 
- Public Member Functions inherited from optk::benchmark
 benchmark (const std::string &name)
 
std::string get_name ()
 
virtual double evaluate (inst::set x)=0
 

Protected Member Functions

void set_opt_param (inst::set op)
 

Protected Attributes

u_int m_dims
 
double m_lb
 
double m_ub
 
double m_opt
 
std::vector< propertiesm_properties
 
inst::set opt_params
 
sspace::sspace_t m_sspace
 
- Protected Attributes inherited from optk::benchmark
std::string m_name
 

Detailed Description

Owing to the similarity of the structure, and subsequent exposition, of the 175 functions in Jamil et al. 2013, we use this as base class for the synthetic benchmarks.

Constructor & Destructor Documentation

◆ synthetic() [1/2]

syn::synthetic::synthetic ( const std::string &  n,
u_int  dims,
double  lb,
double  ub,
double  opt 
)

Base constructor for synthetic benchmarks. Unless overidden by derived calsses, this will expand the provided lower bound, upper bound and dimensionality to a uniform bounded parameter space of type sspace::sspace_t, making use of heap memory allocations.

Parameters
nThe name of the benchmark.
dimsThe number of dimensions in which to run this benchmark.
lbThe lower bound on the parameters constituting the search space.
upThe corresponding upper bound.
optThe global minimum for this function.
opt_paramThe optimal parameters for this function.

◆ synthetic() [2/2]

syn::synthetic::synthetic ( const std::string &  n,
u_int  dims,
double  opt 
)

A simpler base constructor for synthetic benchmarks which have more complicated search spaces which will be manually set in the derived class' constructor.

Parameters
nThe name of the benchmark
dimsThe number of dimensions of this benchmark
optThe global minimum

◆ ~synthetic()

syn::synthetic::~synthetic ( )

This destructor frees the search space which was automatically-generated in the constructor.

Member Function Documentation

◆ get_dims()

u_int syn::synthetic::get_dims ( )
inline

Get the number of dimensions that this problem was instantiated with; or the fixed dimension that the derived function can take.

◆ get_opt()

double syn::synthetic::get_opt ( )
inline

Returns (one of) the known global minima.

◆ get_opt_param()

inst::set syn::synthetic::get_opt_param ( )
inline

Returns the known optimal parameter set.

◆ get_search_space()

sspace::sspace_t* syn::synthetic::get_search_space ( )
inlinevirtual
Returns
The search space for this benchmark. This is passed to the update_search_space method of optimisation algorithms.

Implements optk::benchmark.

◆ set_opt_param()

void syn::synthetic::set_opt_param ( inst::set  op)
protected

Sets the parameters which give the optimum when evaluated. This set needn't be unique; for instance in multimodal functions it is not.

Only call once from the constructor of a derived class; multiple invocations leads to memory leaks. It is 'protected' to guard against this.

Parameters
opThe set of optimal parameter instances.

◆ set_properties()

void syn::synthetic::set_properties ( std::vector< properties p)
inline

This is specific to synthetic benchmarks, and sets the properties of the derived benchmark function (e.g. non-separable, scalable etc...)

Parameters
pA vector of elements from the properties enum.

◆ update_opt()

void syn::synthetic::update_opt ( double  opt)
inline

Update the value of the global minimum.

◆ validate_param_set()

void syn::synthetic::validate_param_set ( inst::set  x)

This function validates that a set of parameter instances provided to be evaluated is compatible with the search space.

Parameters
xThe search space provided by the optimisation algorithm.
Exceptions
std::invalid_argumentwhen the parameter set instance is invalid.

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