![]() |
Ultra 0.9.4
|
#include <problem.h>
Public Member Functions | |
| problem (std::size_t, const interval< int > &) | |
| problem (const std::vector< interval< int > > &) | |
| std::size_t | parameters () const noexcept |
| template<symbol_set::weight_t = symbol_set::default_weight> | |
| integer * | insert (const interval< int > &, symbol::category_t=symbol::undefined_category) |
| Public Member Functions inherited from ultra::problem | |
|
template<Symbol S, symbol_set::weight_t = symbol_set::default_weight, class ... Args> requires std::constructible_from<S, Args...> | |
| std::add_pointer_t< S > | insert (Args &&...) |
| template<std::derived_from< function > F, symbol_set::weight_t W = symbol_set::default_weight, std::convertible_to< symbol::category_t > C = symbol::category_t> | |
| std::add_pointer_t< F > | insert (symbol::category_t, std::initializer_list< C >) |
| template<std::derived_from< function > F, symbol_set::weight_t W = symbol_set::default_weight, std::convertible_to< symbol::category_t > C = symbol::category_t> | |
| std::add_pointer_t< F > | insert (std::initializer_list< C >) |
| virtual bool | is_valid () const |
Additional Inherited Members | |
| Public Attributes inherited from ultra::problem | |
| parameters | params {} |
| symbol_set | sset {} |
Provides a GA-specific interface to the generic problem class.
The class is a facade that provides a simpler interface to represent GA-specific problems.
| ultra::ga::problem::problem | ( | std::size_t | nparam, |
| const interval< int > & | itval ) |
Sets up a GA problem for which a solution has the given number of (uniform, same range) parameters.
| [in] | nparam | number of parameters (aka genes in the chromosome) |
| [in] | itval | a half-open interval (the value of each parameter falls within this range) |
The typical solution of a combinatorial problem can often be represented as a sequence of integers in a given range (and this is the raison d'etre of this constructor).
|
explicit |
Sets up a GA problem for which a solution has the given number of (uniform but not same range) parameters.
| [in] | intervals | a sequence of half-open intervals (one for each parameter) |
This is a more flexible form of the other constructor. Each parameter has its own range.
| integer * ultra::ga::problem::insert | ( | const interval< int > & | itval, |
| symbol::category_t | category = symbol::undefined_category ) |
Adds a ga::integer terminal to the internal symbol set.
| [in] | itval | the half open interval for the integer terminal |
| [in] | category | an optional category |
|
nodiscardnoexcept |