Learn R Programming

DEXiR (version 1.0.2)

evaluate: evaluate

Description

Evaluates decision alternatives. Essentially, this is a bottom-up aggregation method: starting with basic attributes (or pruned aggregate attributes), values of each alternative are gradually aggregated towards the root attribute, according to evaluation_order(). The aggregation at each individual DexiAttribute is governed by the corresponding DexiAttribute$funct. When alternative values are sets or distributions (see DEXiR-package), then evaluate() tries all possible combinations of values of the descendant attributes.

Usage

evaluate(
  model,
  alternatives = model$alternatives,
  root = model$root,
  method = EnumEvalMethod,
  bounding = FALSE,
  prune = list(),
  norm = NULL,
  and = NULL,
  or = NULL
)

Value

A data frame containing both input and output (evaluated) values of alternatives.

Arguments

model

DexiModel.

alternatives

A data frame containing data of one or more decision alternatives.

root

DexiAttribute. Default: model$root.

method

One of: "set" (default), "prob", "fuzzy" or "fuzzynorm".

bounding

logical(1). When TRUE, evaluation results are additionally subjected to bounded_scale_value() to keep them in the bounds set up by the corresponding scale.

prune

character(), containing IDs of aggregate attributes that should be treated as evaluation inputs (rather than basic attributes).

norm

Some normalization function of the form function(num_vector), or NULL.

and

Some conjunctive aggregation function of the form function(num_vector), or NULL.

or

Some disjunctive aggregation function of the form function(num_vector), or NULL.

Details

evaluate() implements four aggregation methods: "set", "prob", "fuzzy" and "fuzzynorm".

The "set" method interprets DEXi values as sets. The output value assigned to some attribute is composed of the union of all attribute$funct evaluations for all possible combinations of values of attribute$inputs.

The remaining three methods interpret DEXi values as value distributions. They follow the same algorithm, but use different functions (see evaluation_parameters()) in three algorithm steps: normalization, and conjunctive and disjunctive aggregation. All values distributions involved in calculations are normalized by the function norm(). All combinations of attribute$input values are individually evaluated by the corresponding tabular function attribute$funct. The value \(p\) of each set of attribute$funct arguments is determined by the conjunctive aggregation function and() over \(p\)'s of individual arguments. Finally, the \(p\) of some output value val is determined by the disjunctive aggregation function or(), applied on the \(p\)'s of all partial evaluations that map to val.

For the mathematical background and more details about aggregation in DEX, please see (Trdin, Bohanec, 2018). For default normalization and aggregation functions, see normalize_function(), and_function() and or_function().

See Also

evaluation_parameters(), normalize_function(), norm_none(), norm_max(), norm_sum(), and_function(), or_function(), bounded_scale_value().

Examples

Run this code
# Load "Car.dxi"
CarDxi <- system.file("extdata", "Car.dxi", package = "DEXiR")
Car <- read_dexi(CarDxi)

alt <- Car$alternative("MyCar_set",
         BUY.PRICE="low", MAINT.PRICE=2, X.PERS="more", X.DOORS="4", LUGGAGE=2, SAFETY="medium")
Car$evaluate(alt)

# Try the set-based evaluation using the default "set" method
alt <- Car$alternative("MyCar2",
       BUY.PRICE="low", MAINT.PRICE="*", X.PERS="more", X.DOORS="4", LUGGAGE=2, SAFETY=2)
Car$evaluate(alt)

# Use value distributions and try the methods "prob", "fuzzy" and "fuzzynorm"
alt <- Car$alternative("MyCar_distr",
       BUY.PRICE="low", MAINT.PRICE=distribution(0.1, 0.6, 0.3),
       X.PERS="more", X.DOORS="4", LUGGAGE=2, SAFETY=2)
Car$evaluate(alt, method = "prob")
Car$evaluate(alt, method = "fuzzy")
Car$evaluate(alt, method = "fuzzynorm")

Run the code above in your browser using DataLab