OPTK  0.1.2
Toolkit for global optimisation algorithms
Public Member Functions | Private Member Functions | Private Attributes | List of all members
random_search Class Reference
Inheritance diagram for random_search:
optk::optimiser

Public Member Functions

void update_search_space (sspace::sspace_t *space) override
 
inst::set generate_parameters (int param_id) override
 
void receive_trial_results (int param_id, inst::set params, double value) override
 
- Public Member Functions inherited from optk::optimiser
 optimiser (std::string name)
 
 ~optimiser ()
 
virtual void clear ()
 
std::string get_name ()
 
void accept (optimisers *o)
 

Private Member Functions

void sample_ss (inst::node *parent)
 

Private Attributes

sspace::sspace_tm_space
 

Additional Inherited Members

- Protected Member Functions inherited from optk::optimiser
void add_to_trials (int param_id, inst::node *n)
 
- Protected Attributes inherited from optk::optimiser
std::unordered_map< int, inst::settrials
 

Member Function Documentation

◆ generate_parameters()

inst::set random_search::generate_parameters ( int  param_id)
overridevirtual

The random search optimiser will simply generate the relevant parameters by calling the sample method of parameters in the search space.

Parameters
param_idA largely disregarded parameter; save for internal memory management.
Returns
A randomly generated set of valid parameters, with no guarantees of uniqueness.

Reimplemented from optk::optimiser.

◆ receive_trial_results()

void random_search::receive_trial_results ( int  param_id,
inst::set  params,
double  value 
)
overridevirtual

Allows the benchmark or program being optimised to communicate back the value of the cost function for a parameter set.

Parameters
param_idThis parameter id is used to identify the parameters used to generate the result.
parametersFor increased flexibility, the actual parameters used to generate the result are also copied back.
valueThe actual value of the objective function.

Reimplemented from optk::optimiser.

◆ sample_ss()

void random_search::sample_ss ( inst::node parent)
private

This function recursively traverses the search space, sampling a value at random from each of the parameters.

Parameters
parentA pointer to the parent instance node to which to store the results.

◆ update_search_space()

void random_search::update_search_space ( sspace::sspace_t space)
overridevirtual

This updates the search space defined by the optimiser.

Parameters
spaceThe new search space to use

Reimplemented from optk::optimiser.

Member Data Documentation

◆ m_space

sspace::sspace_t* random_search::m_space
private

A copy of the problem search space


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