Set values of a single decision alternative and represent it with a data frame. Usually, only input values are set in this way. The data frame can then be evaluated to set the values of output attributes.
set_alternative(model, alternative, ...)
A one-row data frame with columns corresponding to model
's attributes, collectively
representing a single decision alternative. The columns not copied from alternative
(as a data frame)
nor set by any parameter contain NA
s.
A DexiModel object. Required.
character(1)
or data.frame
. The first form sets the name of the
newly created decision alternative. The second form copies values from alternative[1, ]
to initialize the corresponding columns of the resulting data frame.
A list of parameters specifying the values of the newly created decision alternative.
Each parameter is expected to be in the form attribute_id=attribute_value
, or is a list of
elements of the same form.
There are several possible ways to specify attribute_value
.
Taking the scale CAR = {"unacc"; "acc"; "good"; "exc"}
as an example, the options are:
CAR="unacc"
A single qualitative value.
CAR=2
An ordinal number, indicating "acc"
in this case.
CAR=c("good", "exc")
A set of qualitative values.
CAR=c(3, 4)
A set of ordinal numbers, equivalent to the above.
CAR=list("good", 4)
A set specified by a mixture of qualitative values and ordinal numbers.
CAR="*"
A full range of ordinal numbers, in this case equivalent to 1:4
.
CAR=distribution(0, 0, 0.7, 0.3)
A value distribution.
CAR=list("good"=0.7, "exc"=0.3)
A value distribution, equivalent to the above.
CAR="undef"
An unknown value, interpreted as NA
.
For attributes associated with continuous scales,
only numeric(1)
attribute_value
s are allowed.
DEXiR-package notes on values in DEXi models.