src
fields2cover
objectives
hg_obj
hg_objective.cpp
Go to the documentation of this file.
1
//=============================================================================
2
// Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3
// Author: Gonzalo Mier
4
// BSD-3 License
5
//=============================================================================
6
7
#include "
fields2cover/objectives/hg_obj/hg_objective.h
"
8
9
namespace
f2c::obj
{
10
11
double
HGObjective::computeCost
(
12
const
F2CCell
& total_cell,
const
F2CCell
& rem_cell) {
13
return
computeCost
(
14
static_cast<
F2CCells
>
(total_cell),
static_cast<
F2CCells
>
(rem_cell));
15
}
16
double
HGObjective::computeCost
(
17
const
F2CCell
& total_cell,
const
F2CCells
& rem_cell) {
18
return
computeCost
(
static_cast<
F2CCells
>
(total_cell), rem_cell);
19
}
20
double
HGObjective::computeCost
(
21
const
F2CCells
& total_cell,
const
F2CCell
& rem_cell) {
22
return
computeCost
(total_cell,
static_cast<
F2CCells
>
(rem_cell));
23
}
24
double
HGObjective::computeCost
(
25
const
F2CCells
& total_cell,
const
F2CCells
& rem_cell) {
26
return
1 - total_cell.
difference
(rem_cell).
area
() / total_cell.
area
();
27
}
28
29
}
// namespace f2c::obj
30
f2c::types::Geometries::area
double area() const
Compute area of the geometry.
Definition:
Geometries_impl.hpp:14
f2c::obj::HGObjective::computeCost
virtual double computeCost(const F2CCells &total_cell, const F2CCell &rem_cell)
Definition:
hg_objective.cpp:20
f2c::types::Cell
Definition:
Cell.h:32
f2c::obj
Objective algorithms' namespace.
Definition:
base_objective.h:14
hg_objective.h
f2c::obj::HGObjective::computeCost
virtual double computeCost(const F2CCell &total_cell, const F2CCell &rem_cell)
Definition:
hg_objective.cpp:11
f2c::types::Cells::difference
Cells difference(const Cell &c) const
Definition:
Cells.cpp:164
f2c::types::Cells
Definition:
Cells.h:21
fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31