utility.endnode.cond.create: Construct a conditional end node

View source: R/utility.endnode.cond.r

utility.endnode.cond.createR Documentation

Construct a conditional end node

Description

Function to construct a node that makes a choice between given end nodes based on the levels of discrete attributes.

Usage

utility.endnode.cond.create(name.node, 
                            attrib.levels, 
                            nodes, 
                            utility      = TRUE, 
                            required     = FALSE, 
                            col          = "black", 
                            shift.levels = 0)

Arguments

name.node

name of the node to be constructed as a character string.

attrib.levels

data frame with attribute names as column names and all discrete attribute level combinations in the rows. This may be a dependence on any number of attributes. As combinatorics can lead to a very large number of possible combinations, the node should not depend on a too large number of attributes, in particular if each attribute has many different levels expressed by numbers or character strings.

nodes

list of the length of the number of columns of the data frame specifed as argument attrib.levels above containing the nodes to be associated with the attribute level combinations specified in the rows of attrib.levels.

utility

(optional) logical variable indicating if a value function (FALSE) or a utility function (TRUE) is created. Default value is TRUE.

required

(optional) logical variable indicating if the value of this node is required for aggregation at the next higher level. If this variable is TRUE, aggregation at the next higher level is not possible if this node returns NA. Default value is FALSE.

col

(optional) color used for plotting the bounding box of the node in the objective hierarchy. Default value is "black".

shift.levels

(optional) number of hierarchical levels by which the node in the objective hierarchy is shifted to make a branch fit better to other branches. Default value is 0.

Value

The function returns the created object of type utility.endnode.cond with the properties specified in the arguments of the function.

Author(s)

Peter Reichert <peter.reichert@emeriti.eawag.ch>

References

Short description of the package:

Reichert, P., Schuwirth, N. and Langhans, S., Constructing, evaluating and visualizing value and utility functions for decision support, Environmental Modelling & Software 46, 283-291, 2013.

Textbooks on the use of utility and value functions in decision analysis:

Keeney, R. L. and Raiffa, H. Decisions with Multiple Objectives - Preferences and Value Tradeoffs. John Wiley & Sons, 1976.

Eisenfuehr, F., Weber, M. and Langer, T., Rational Decision Making, Springer, Berlin, 2010.

See Also

Print, evaluate and plot the node with

print.utility.endnode.cond,
summary.utility.endnode.cond,
evaluate.utility.endnode.cond and
plot.utility.endnode.cond.

Create other end nodes with

utility.endnode.discrete.create,
utility.endnode.parfun1d.create,
utility.endnode.intpol2d.create,
utility.endnode.parfun1d.create, or
utility.endnode.firstavail.create.

Create other types of nodes with

utility.aggregation.create,
utility.conversion.intpol.create, or
utility.conversion.parfun.create.

Examples

  bedmod_riprap <-
    utility.endnode.intpol1d.create(
      name.node   = "bed modification riprap",
      name.attrib = "bedmodfract_percent",
      range       = c(0,100),
      x           = c(0,10,30,100),
      u           = c(1,0.775,0.5625,0.24),
      required    = FALSE,
      utility     = FALSE)
  
  bedmod_other <-
    utility.endnode.intpol1d.create(
      name.node   = "bed modification other",
      name.attrib = "bedmodfract_percent",
      range       = c(0,100),
      x           = c(0,10,30,100),
      u           = c(1,0.775,0.5625,0),
      required    = FALSE,
      utility     = FALSE)
  
  bedmod <-
    utility.endnode.cond.create(
      name.node     = "bed modification",
      attrib.levels = data.frame(bedmodtype_class=
                                 c("riprap","other")),
      nodes         = list(bedmod_riprap,bedmod_other),
      required      = FALSE,
      utility       = FALSE)

  print(bedmod)
  plot(bedmod)

utility documentation built on Aug. 28, 2023, 1:07 a.m.