Class BilinearContinuousFunctionType

java.lang.Object
nz.org.riskscape.defaults.interp.BilinearContinuousFunctionType
All Implemented Interfaces:
nz.org.riskscape.engine.types.Type

public class BilinearContinuousFunctionType extends Object
  • Field Details

    • ANY_BILINEAR

      public static final BilinearContinuousFunctionType ANY_BILINEAR
    • ONE_DIMENSIONAL

      public static final int ONE_DIMENSIONAL
      See Also:
    • TWO_DIMENSIONAL

      public static final int TWO_DIMENSIONAL
      See Also:
    • ANY

      public static final nz.org.riskscape.defaults.interp.ContinuousFunctionType ANY
    • dimensions

      protected final int dimensions
    • valueExpression

      protected final nz.org.riskscape.engine.rl.RealizedExpression valueExpression

      An expression to evaluate to plot the points of this curve type. The expression will be evaluated with ContinuousFunction#lamba and values for each of the curves dimensions.

    • returnType

      protected final nz.org.riskscape.engine.types.Type returnType

      The return type. Based on value expressions return type be should take account of interpolation.

    • asStruct

      protected final nz.org.riskscape.engine.types.Struct asStruct
  • Method Details

    • applyTo

      public Object applyTo(Object func, double... dimensionValues)

      Compute an interpolated y for a given x

      Parameters:
      func - the function to interpolate a y value for
      dimensionValues - a value for each of the dimensions this function accepts
      Returns:
      a value corresponding to #getYValueType()
    • visit

      public <T, U> U visit(nz.org.riskscape.engine.types.TypeVisitor<T,U> tv, T data)
      Specified by:
      visit in interface nz.org.riskscape.engine.types.Type
    • toString

      public String toString()
    • equals

      public boolean equals(Object o)
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
    • getValueType

      protected nz.org.riskscape.engine.types.Type getValueType()
    • asStruct

      public nz.org.riskscape.engine.types.Struct asStruct()
      Specified by:
      asStruct in interface nz.org.riskscape.engine.types.Type
    • coerce

      public Object coerce(Object value) throws nz.org.riskscape.engine.types.CoercionException
      Specified by:
      coerce in interface nz.org.riskscape.engine.types.Type
      Throws:
      nz.org.riskscape.engine.types.CoercionException
    • estimateSize

      public int estimateSize(Object entry)
      Specified by:
      estimateSize in interface nz.org.riskscape.engine.types.Type
    • fromBytes

      public Object fromBytes(DataInputStream in) throws IOException
      Specified by:
      fromBytes in interface nz.org.riskscape.engine.types.Type
      Throws:
      IOException
    • toBytes

      public void toBytes(DataOutputStream os, Object toWrite) throws IOException
      Specified by:
      toBytes in interface nz.org.riskscape.engine.types.Type
      Throws:
      IOException
    • internalType

      public Class<?> internalType()
      Specified by:
      internalType in interface nz.org.riskscape.engine.types.Type
    • isA

      public <T extends nz.org.riskscape.engine.types.Type> boolean isA(Class<T> type)
      Specified by:
      isA in interface nz.org.riskscape.engine.types.Type
    • getDimensions

      public int getDimensions()
    • getValueExpression

      public nz.org.riskscape.engine.rl.RealizedExpression getValueExpression()

      An expression to evaluate to plot the points of this curve type. The expression will be evaluated with ContinuousFunction#lamba and values for each of the curves dimensions.

    • getReturnType

      public nz.org.riskscape.engine.types.Type getReturnType()

      The return type. Based on value expressions return type be should take account of interpolation.