|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <types.hpp>
Public Member Functions | |
| choice (std::string n, sspace_t *options) | |
| sspace_t * | options () |
| long unsigned int | count () |
| param_t * | get (long unsigned int i) |
Public Member Functions inherited from sspace::param_t | |
| param_t (std::string n, pt t) | |
| virtual | ~param_t () |
| virtual pt | get_type () |
| virtual std::string | get_name () |
Private Attributes | |
| sspace_t * | m_options |
A parameter of type choice takes on one of the provided options as its value.
This differs from the categorical parameter type above since parameter values can be other parameter types. This allows for nested search spaces to be created.
Proper handling of this type by optimisation algorithms requires recursively registering each of the options.
| sspace::choice::choice | ( | std::string | n, |
| sspace_t * | options | ||
| ) |
The constructor
| n | the name of the parameter |
| options | the values choice may take on. |
| long unsigned int sspace::choice::count | ( | ) |
Counts the options
| sspace::param_t * sspace::choice::get | ( | long unsigned int | i | ) |
Retreive the ith element
| i | the index of the element to fetch |
| std::range_error | on i out of bounds |
| sspace::sspace_t * sspace::choice::options | ( | ) |
lists out all the options that this parameter can take on
|
private |
This is what allows us to construct nested search spaces. Memory for the nested space is allocated
1.8.13