compare_two_alternatives {DEXiR} | R Documentation |
compare_two_alternatives
Description
Compare alternatives alt1
and alt2
with respect to attributes
.
Usage
compare_two_alternatives(alt1, alt2, attributes, deep = TRUE)
Arguments
alt1 |
|
alt2 |
|
attributes |
Vector of DexiAttribute objects. |
deep |
|
Value
numeric(length(attributes))
.
Each element represents the outcome of comparison w.r.t. the corresponding attribute.
Possible outcomes:
0
Values are equal.
-1
alt1
's value is worse thanalt2
's.+1
alt1
's value is better thanalt2
's.NA
Values are incomparable.
When deep = TRUE
, the so-called deep comparison is performed:
when the compared attribute's values are equal,
subordinate attributes are checked for differences, possibly returning
-0.5
(indicating the weak preference relation "<=") or
+0.5
(indicating the weak preference relation ">=").
See Also
Examples
# Load "Car.dxi"
CarDxi <- system.file("extdata", "Car.dxi", package = "DEXiR")
Car <- read_dexi(CarDxi)
compare_two_alternatives(Car$alternatives[1,], Car$alternatives[2,], Car$attributes)
# c(NA, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1)