Class CreateContinuousFunction

java.lang.Object
nz.org.riskscape.defaults.interp.CreateContinuousFunction
All Implemented Interfaces:
nz.org.riskscape.engine.rl.RealizableFunction

public class CreateContinuousFunction extends Object implements nz.org.riskscape.engine.rl.RealizableFunction

Builds a continuous function from a lambda expression and a series of x values to allow a complex function to be estimated and then stacked on top of other functions to avoid the overhead in calling it gajjilions of times.

This can be a useful optimisation in probabilistic modelling where hundreds of thousands of consequences needed to be computed for each exposure. We can coalesce nearby exposures to a particular site where a hazard occurs, create a continuous function for each exposure with likely (numeric) hazard intensity values, stack the functions at each site, then call the function once at each site to compute a consequence for the entire site. In the case of a non-trivial loss function and hundreds of thousands of exposures, this can reduce computation time down dramatically.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface nz.org.riskscape.engine.rl.RealizableFunction

    nz.org.riskscape.engine.rl.RealizableFunction.MetadataIdentifiedRealizableFunction
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    nz.org.riskscape.engine.function.RiskscapeFunction
     
    nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction>
    realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, List<nz.org.riskscape.engine.types.Type> argumentTypes)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CreateContinuousFunction

      public CreateContinuousFunction()
  • Method Details

    • realize

      public nz.org.riskscape.problem.ResultOrProblems<nz.org.riskscape.engine.function.RiskscapeFunction> realize(nz.org.riskscape.engine.rl.RealizationContext context, nz.org.riskscape.rl.ast.FunctionCall functionCall, List<nz.org.riskscape.engine.types.Type> argumentTypes)
      Specified by:
      realize in interface nz.org.riskscape.engine.rl.RealizableFunction
    • asFunction

      public nz.org.riskscape.engine.function.RiskscapeFunction asFunction()