OPTK  0.1.2
Toolkit for global optimisation algorithms
Public Member Functions | Private Attributes | List of all members
sspace::choice Class Reference

#include <types.hpp>

Inheritance diagram for sspace::choice:
sspace::param_t

Public Member Functions

 choice (std::string n, sspace_t *options)
 
sspace_toptions ()
 
long unsigned int count ()
 
param_tget (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_tm_options
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ choice()

sspace::choice::choice ( std::string  n,
sspace_t options 
)

The constructor

Parameters
nthe name of the parameter
optionsthe values choice may take on.

Member Function Documentation

◆ count()

long unsigned int sspace::choice::count ( )

Counts the options

Returns
The number of options for this parameter.

◆ get()

sspace::param_t * sspace::choice::get ( long unsigned int  i)

Retreive the ith element

Parameters
ithe index of the element to fetch
Returns
the ith parameter in the options array.
Exceptions
std::range_erroron i out of bounds

◆ options()

sspace::sspace_t * sspace::choice::options ( )

lists out all the options that this parameter can take on

Returns
a pointer to the list of options

Member Data Documentation

◆ m_options

sspace_t* sspace::choice::m_options
private

This is what allows us to construct nested search spaces. Memory for the nested space is allocated


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