problem.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "pass_bits/config.hpp"
4 #include <algorithm>
5 #include <armadillo>
6 #include <cassert>
7 #include <cmath>
8 #include <vector>
9 #include <string>
10 
11 #if defined(SUPPORT_MPI)
12 #include <mpi.h>
13 #endif
14 namespace pass
15 {
20 class problem
21 {
22 public:
29  const arma::vec lower_bounds;
30 
37  const arma::vec upper_bounds;
38 
42  const std::string name;
43 
48  arma::vec bounds_range() const noexcept;
49 
53  arma::uword dimension() const noexcept;
54 
59  problem(const arma::uword dimension, const double lower_bound,
60  const double upper_bound, const std::string &name);
61 
66  problem(const arma::vec &lower_bounds, const arma::vec &upper_bounds, const std::string &name);
67 
72  virtual double evaluate(const arma::vec &agent) const = 0;
73 
79  double evaluate_normalised(const arma::vec &normalised_agent) const;
80 
85  arma::mat normalised_random_agents(const arma::uword count) const;
86 
95  arma::mat normalised_hammersley_agents(const arma::uword count) const;
96 
102  arma::mat initialise_normalised_agents(const arma::uword count) const;
103 };
104 
105 } // namespace pass
const std::string name
Definition: problem.hpp:42
const arma::vec upper_bounds
Definition: problem.hpp:37
arma::mat normalised_random_agents(const arma::uword count) const
Definition: problem.cpp:44
arma::mat initialise_normalised_agents(const arma::uword count) const
Definition: problem.cpp:97
const arma::vec lower_bounds
Definition: problem.hpp:29
arma::mat normalised_hammersley_agents(const arma::uword count) const
Definition: problem.cpp:50
Definition: problem.hpp:20
arma::uword dimension() const noexcept
Definition: problem.cpp:10
Definition: adaptive_parameter_search.hpp:5
double evaluate_normalised(const arma::vec &normalised_agent) const
Definition: problem.cpp:39
arma::vec bounds_range() const noexcept
Definition: problem.cpp:5
virtual double evaluate(const arma::vec &agent) const =0