|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <types.hpp>
Public Member Functions | |
| randint (std::string n, int lower, int upper) | |
| int | sample () |
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 () |
Public Attributes | |
| int | m_lower |
| int | m_upper |
Private Attributes | |
| std::random_device | rd |
| std::mt19937 | generator |
| std::uniform_int_distribution< int > | dist |
A randint parameter has value chosen at random within the upper and lower bounds.
The lower bound is inclusive, while the upper bound is exclusive.
| sspace::randint::randint | ( | std::string | n, |
| int | lower, | ||
| int | upper | ||
| ) |
The constructor
| n | the name of this parameter |
| lower | the lower bound |
| upper | the upper bound |
| int sspace::randint::sample | ( | ) |
Sample from the random distribution (exclusive of upper bound).
| int sspace::randint::m_lower |
Bounds of the selection range. Encapsulation should be irrelevant here so we save the effort of making getters/setters and just make these members public...
1.8.13