R/realistic_df.R

Defines functions realisticDF.composite.desire.function realisticDF.desire.function realisticDF.default print.realistic.desire.function realisticDF

Documented in realisticDF realisticDF.desire.function

##
## realistic_df.R - realistic desirability functions
##
## Authors:
##  Heike Trautmann  <[email protected]>
##  Detlef Steuer    <[email protected]>
##  Olaf Mersmann    <[email protected]>
##

realisticDF <- function(f, ...)
  UseMethod("realisticDF", f)

## Print method:
print.realistic.desire.function <- function(x, ...) {
  cat("Realistic ")
  print(environment(x)$f)
}
  
realisticDF.default <- function(f, ...)
  stop("Not implemented")

realisticDF.desire.function <- function(f, ...) {  
  ev <- function(x, sd)
    edesire(f, x, sd)
  
  class(ev) <- c("realistic.desire.function", class(f))
  attr(ev, "desire.type") <- paste("Realistic", attr(f, "desire.type"))
  attr(ev, "y.range") <- attr(f, "y.range")
  return(ev) 
}

realisticDF.composite.desire.function <- function(f, ...)
  stop("Please wrap a realistic desirability instead of applying realisticDF to a wrapped desirability.")

Try the desire package in your browser

Any scripts or data that you put into this service are public.

desire documentation built on May 31, 2017, 4:06 a.m.