whv_rect: Compute (total) weighted hypervolume given a set of...

View source: R/whv.R

whv_rectR Documentation

Compute (total) weighted hypervolume given a set of rectangles

Description

Calculates the hypervolume weighted by a set of rectangles (with zero weight outside the rectangles). The function total_whv_rect() calculates the total weighted hypervolume as hypervolume() + scalefactor * abs(prod(reference - ideal)) * whv_rect(). The details of the computation are given by \citetDiaLop2020ejor.

Usage

whv_rect(data, rectangles, reference, maximise = FALSE)

total_whv_rect(
  data,
  rectangles,
  reference,
  maximise = FALSE,
  ideal = NULL,
  scalefactor = 0.1
)

Arguments

data

(matrix | data.frame)
Matrix or data frame of numerical values, where each row gives the coordinates of a point.

rectangles

(matrix()) Weighted rectangles that will bias the computation of the hypervolume. Maybe generated by eafdiff() with rectangles=TRUE or by choose_eafdiff().

reference

(numeric())
Reference point as a vector of numerical values.

maximise

(logical() | logical(1))
Whether the objectives must be maximised instead of minimised. Either a single logical value that applies to all objectives or a vector of logical values, with one value per objective.

ideal

(numeric())
Ideal point as a vector of numerical values. If NULL, it is calculated as minimum (resp. maximum if maximising that objective) of each objective in data.

scalefactor

(numeric(1)) real value within (0,1] that scales the overall weight of the differences. This is parameter psi (\psi) in \citetDiaLop2020ejor.

Details

TODO

Value

A single numerical value.

References

\insertAllCited

See Also

read_datasets(), eafdiff(), choose_eafdiff(), whv_hype()

Examples



rectangles <- as.matrix(read.table(header=FALSE, text='
 1.0  3.0  2.0  Inf    1
 2.0  3.5  2.5  Inf    2
 2.0  3.0  3.0  3.5    3
'))
whv_rect (matrix(2, ncol=2), rectangles, reference = 6)
whv_rect (matrix(c(2, 1), ncol=2), rectangles, reference = 6)
whv_rect (matrix(c(1, 2), ncol=2), rectangles, reference = 6)

total_whv_rect (matrix(2, ncol=2), rectangles, reference = 6, ideal = c(1,1))
total_whv_rect (matrix(c(2, 1), ncol=2), rectangles, reference = 6, ideal = c(1,1))
total_whv_rect (matrix(c(1, 2), ncol=2), rectangles, reference = 6, ideal = c(1,1))


eaf documentation built on Sept. 11, 2024, 8:45 p.m.