29 namespace pagmo {
namespace util {
namespace hv_algorithm {
67 unsigned int n = points.size();
68 unsigned int dim = r_point.size();
69 boost::uint_fast64_t T =
static_cast<boost::uint_fast64_t
>( 12. * std::log( 1. / m_delta ) / std::log( 2. ) * n / m_eps / m_eps );
72 std::vector<double> sums(n, 0.0);
75 std::vector<fitness_vector>::iterator it_p;
78 std::vector<double>::iterator it_sums;
84 for(it_p = points.begin() ; it_p != points.end() ; ++it_p) {
88 unsigned long long M = 0;
89 unsigned long long M_sum = 0;
96 double r = m_drng() * V;
99 it_sums = std::lower_bound(sums.begin(), sums.end(), r);
100 i = std::distance(sums.begin(), it_sums);
103 for(
unsigned int d_idx = 0 ; d_idx < dim ; ++d_idx) {
104 rnd_point[d_idx] = (points[i][d_idx] + m_drng() * (r_point[d_idx] - points[i][d_idx]));
110 return (T * V) /
static_cast<double>(n * M);
112 j =
static_cast<unsigned int>(n * m_drng());
114 }
while (!(
base::dom_cmp(rnd_point, points[j]) == base::DOM_CMP_B_DOMINATES_A));
128 pagmo_throw(value_error,
"This method is not supported by the bf_fpras algorithm");
139 pagmo_throw(value_error,
"This method is not supported by the bf_fpras algorithm");
150 pagmo_throw(value_error,
"This method is not supported by the bf_fpras algorithm");
161 pagmo_throw(value_error,
"This method is not supported by the bf_fpras algorithm");
173 return "Hypervolume algorithm based on FPRAS";
unsigned int greatest_contributor(std::vector< fitness_vector > &, const fitness_vector &) const
Greatest contributor method.
std::vector< double > contributions(std::vector< fitness_vector > &, const fitness_vector &) const
Contributions method.
double exclusive(const unsigned int, std::vector< fitness_vector > &, const fitness_vector &) const
Exclusive method.
bf_fpras(const double eps=1e-2, const double delta=1e-2)
Constructor.
void verify_before_compute(const std::vector< fitness_vector > &, const fitness_vector &) const
Verify before compute.
static double volume_between(const fitness_vector &, const fitness_vector &, unsigned int=0)
Compute volume between two points.
void assert_minimisation(const std::vector< fitness_vector > &, const fitness_vector &) const
Assert that reference point dominates every other point from the set.
std::string get_name() const
Algorithm name.
static int dom_cmp(double *, double *, unsigned int)
Dominance comparison method.
base_ptr clone() const
Clone method.
std::vector< double > fitness_vector
Fitness vector type.
boost::shared_ptr< base > base_ptr
Base hypervolume algorithm class.
Bringmann-Friedrich approximation method.
double compute(std::vector< fitness_vector > &, const fitness_vector &) const
Compute method.
unsigned int least_contributor(std::vector< fitness_vector > &, const fitness_vector &) const
Least contributor method.