dynamic_bin_val¶
Classes¶
Pareto¶
-
class Pareto : public ioh::problem::DynamicBinVal¶
Public Functions
-
inline Pareto(const int instance, const int n_variables)¶
Constructs a new instance of DynamicBinValPowersOfTwo.
- Parameters:
instance – the random instance of the problem
n_variables – The dimension of the problem, representing the size of the search space and indicating the number of variables in the problem.
-
inline double get_pareto_shape() const¶
Public Static Attributes
-
static constexpr int registry_id = 10003¶
The id in the registry, also used by the constructor.
-
static constexpr const char *registry_name = "DynamicBinValPareto"¶
The name in the registry, also used by the constructor.
Protected Functions
-
inline virtual void update_weights() override¶
Private Members
-
double pareto_shape_¶
-
inline Pareto(const int instance, const int n_variables)¶
PowersOfTwo¶
-
class PowersOfTwo : public ioh::problem::DynamicBinVal¶
This class serves to represent dynamic binary value problems within the context of Iterative Optimization Heuristics (IOH).
PowersOfTwo: takes a value among the powers 2**1, 2**2, 2**3, …, 2**31 / n_variables for each weight at each time_step
Derives from DynamicBinVal (an IntegerSingleObjective); its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry). It encapsulates characteristics and behaviours specific to dynamic binary value problems and holds vital data members such as time_step and weights, which are crucial in depicting the dynamic aspects and unique features of these problem instances.
Public Functions
-
inline PowersOfTwo(const int instance, const int n_variables)¶
Constructs a new instance of DynamicBinValPowersOfTwo.
- Parameters:
instance – the random instance of the problem
n_variables – The dimension of the problem, representing the size of the search space and indicating the number of variables in the problem.
Public Static Attributes
-
static constexpr int registry_id = 10002¶
The id in the registry, also used by the constructor.
-
static constexpr const char *registry_name = "DynamicBinValPowersOfTwo"¶
The name in the registry, also used by the constructor.
Protected Functions
-
inline virtual void update_weights() override¶
-
inline PowersOfTwo(const int instance, const int n_variables)¶
Ranking¶
-
class Ranking : public ioh::problem::DynamicBinVal¶
Represents dynamic binary value problems in Iterative Optimization Heuristics (IOH).
It inherits from IntegerSingleObjective and includes additional functionalities for dynamic problems. This class encapsulates the unique dynamic features such as changing optimum and comparison order over time.
Public Functions
-
inline Ranking(const int instance, const int n_variables)¶
Constructs a new instance of DynamicBinValRanking.
- Parameters:
instance – random instance
n_variables – The dimension of the problem, representing the size of the search space and indicating the number of variables in the problem.
-
inline virtual int step() override¶
-
inline std::vector<std::vector<int>> rank(const std::vector<std::vector<int>> &bitstrings)¶
Sorts the given bitstrings lexicographically based on the ranking permutation.
- Parameters:
bitstrings – The list of bitstrings to be sorted.
- Returns:
A sorted list of bitstrings.
-
inline std::vector<int> rank_indices(const std::vector<std::vector<int>> &bitstrings)¶
Returns the indices of the given bitstrings sorted lexicographically based on the ranking permutation.
This function generates a list of indices representing the order in which the bitstrings would be sorted. It uses the same comparison criteria as the rank function, but instead of sorting the bitstrings themselves, it sorts their indices. This is useful for understanding the original positions of the bitstrings in the sorted order.
- Parameters:
bitstrings – The list of bitstrings for which the sorted indices are to be obtained.
- Returns:
A vector of indices indicating the sorted order of the bitstrings.
-
inline const std::vector<int> &get_comparison_ordering() const¶
Public Members
-
std::vector<int> comparison_ordering¶
Defines the comparison order for lexicographical sorting of bitstrings.
This vector determines the priority of indices for comparison.
EXAMPLE: If comparison_ordering is [1, 2, 0], index 1 has the highest priority in comparisons. If we get two vectors [1, 0, 0] and [0, 0, 1], then the second vector is larger because location 1 has the same value and at location 2, 1 is greater than 0. We have never reached location 0, which was to be compared last according to the comparison ordering [1, 2, 0].
Public Static Attributes
-
static constexpr int registry_id = 10004¶
The id in the registry, also used by the constructor.
-
static constexpr const char *registry_name = "DynamicBinValRanking"¶
The name in the registry, also used by the constructor.
Protected Functions
-
inline double evaluate(const std::vector<int> &x) override¶
Evaluates the fitness of a bitstring for the OneMax problem.
The OneMax problem aims to maximize the number of 1s in a binary string. This function calculates the fitness of a given binary vector by summing its elements. Since the vector contains only 0s and 1s, this sum is equivalent to counting the number of 1s in the vector, which is the desired fitness measure for the OneMax problem.
- Parameters:
x – The binary vector to be evaluated.
- Returns:
The fitness score, which is the sum of elements in the vector (number of 1s).
-
inline virtual double transform_objectives(const double y) override¶
overwrite do nothing
-
inline std::vector<int> transform_variables(std::vector<int> x) override¶
overwrite do nothing
-
inline Ranking(const int instance, const int n_variables)¶
Uniform¶
-
class Uniform : public ioh::problem::DynamicBinVal¶
This class serves to represent dynamic binary value problems within the context of Iterative Optimization Heuristics (IOH).
Uniform: takes a value between 0 and 1 for each component at each time_step
Derives from DynamicBinVal (an IntegerSingleObjective); its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry). It encapsulates characteristics and behaviours specific to dynamic binary value problems and holds vital data members such as time_step and weights, which are crucial in depicting the dynamic aspects and unique features of these problem instances.
Public Functions
-
inline Uniform(const int instance, const int n_variables)¶
Constructs a new instance of DynamicBinValUniform.
- Parameters:
instance – the random instance of the problem
n_variables – The dimension of the problem, representing the size of the search space and indicating the number of variables in the problem.
Public Static Attributes
-
static constexpr int registry_id = 10001¶
The id in the registry, also used by the constructor.
-
static constexpr const char *registry_name = "DynamicBinValUniform"¶
The name in the registry, also used by the constructor.
Protected Functions
-
inline virtual void update_weights() override¶
-
inline Uniform(const int instance, const int n_variables)¶
Structs¶
rng¶
Functions¶
portable_shuffle¶
-
template<typename RandomGenerator>
void ioh::problem::dynamic_bin_val::portable_shuffle(std::vector<int> &array, RandomGenerator &generator)¶