Package localsolver

Class LSEvaluationPoint


  • public class LSEvaluationPoint
    extends java.lang.Object
    An evaluation point associated with an external function with surrogate modeling. Evaluation points are used to specify known points for a function in advance. It can be useful to warm-start the solver when the function is particularly expensive to evaluate, or if you already have a good estimate of the optimal point.

    Note: This information is used by the solver to drive the solution process. You must be careful about the data you provide: if an incorrect value is given, the solver may have an unexpected behavior.

    Since:
    10.0
    See Also:
    LSSurrogateParameters.createEvaluationPoint(), LSSurrogateParameters.getEvaluationPoint(int pos)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addArgument​(double value)
      Adds a double argument with the given value.
      void addArgument​(long value)
      Adds an integer argument with the given value.
      boolean equals​(java.lang.Object obj)  
      LSArray getArrayReturnValue()
      Returns the return value of this evaluation point.
      double getDoubleArgument​(int pos)
      Returns the value of the argument at the given position.
      double getDoubleReturnValue()
      Returns the return value of this evaluation point.
      long getIntArgument​(int pos)
      Returns the value of the argument at the given position.
      long getIntReturnValue()
      Returns the return value of this evaluation point.
      int hashCode()  
      boolean isArrayReturnValue()
      Returns true if the external function associated with this evaluation point is an array function, false otherwise.
      boolean isDoubleArgument​(int pos)
      Returns true if the argument at this given position is a double, false otherwise.
      boolean isDoubleReturnValue()
      Returns true if the external function associated with this evaluation point is a double function, false otherwise.
      boolean isIntArgument​(int pos)
      Returns true if the argument at this given position is an integer, false otherwise.
      boolean isIntReturnValue()
      Returns true if the external function associated with this evaluation point is an integer function, false otherwise.
      void setArgument​(int pos, double value)
      Sets the value of the argument at the given position.
      void setArgument​(int pos, long value)
      Sets the value of the argument at the given position.
      void setReturnValue​(double value)
      Sets the return value of this evaluation point.
      void setReturnValue​(double[] value)
      Sets the return value of this evaluation point.
      void setReturnValue​(long value)
      Sets the return value of this evaluation point.
      void setReturnValue​(long[] value)
      Sets the return value of this evaluation point.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • addArgument

        public void addArgument​(long value)
        Adds an integer argument with the given value. Only allowed if the associated decision variable is an integer or a boolean. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        value - Value of the argument.
      • addArgument

        public void addArgument​(double value)
        Adds a double argument with the given value. Only allowed if the associated decision variable is a double. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        value - Value of the argument.
      • setArgument

        public void setArgument​(int pos,
                                long value)
        Sets the value of the argument at the given position. Only allowed if this argument is an integer or a boolean. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        pos - Position in the argument list.
        value - Value of the argument.
      • setArgument

        public void setArgument​(int pos,
                                double value)
        Sets the value of the argument at the given position. Only allowed if this argument is a double. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        pos - Position in the argument list.
        value - Value of the argument.
      • setReturnValue

        public void setReturnValue​(long value)
        Sets the return value of this evaluation point. Only allowed if the external function associated with this evaluation point is an integer function. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        value - Return value of this point.
      • setReturnValue

        public void setReturnValue​(double value)
        Sets the return value of this evaluation point. Only allowed if the external function associated with this evaluation point is a double function. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        value - Return value of this point.
      • setReturnValue

        public void setReturnValue​(long[] value)
        Sets the return value of this evaluation point. Only allowed if the external function associated with this evaluation point is an integer array function. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        value - Return value of this point.
      • setReturnValue

        public void setReturnValue​(double[] value)
        Sets the return value of this evaluation point. Only allowed if the external function associated with this evaluation point is a double array function. Only allowed in states LSState.Modeling or LSState.Stopped.
        Parameters:
        value - Return value of this point.
      • isIntReturnValue

        public boolean isIntReturnValue()
        Returns true if the external function associated with this evaluation point is an integer function, false otherwise. You can retrieve the value with getIntReturnValue().
        Returns:
        True if the return value is an integer.
      • isDoubleReturnValue

        public boolean isDoubleReturnValue()
        Returns true if the external function associated with this evaluation point is a double function, false otherwise. You can retrieve the value with getDoubleReturnValue().
        Returns:
        True if the return value is a double.
      • isArrayReturnValue

        public boolean isArrayReturnValue()
        Returns true if the external function associated with this evaluation point is an array function, false otherwise. You can retrieve the value with getArrayReturnValue().
        Returns:
        True if the return value is an array.
      • isIntArgument

        public boolean isIntArgument​(int pos)
        Returns true if the argument at this given position is an integer, false otherwise. You can retrieve the value with getIntArgument(int).
        Parameters:
        pos - Position in the argument list.
        Returns:
        True if the argument at this given position is an integer.
      • isDoubleArgument

        public boolean isDoubleArgument​(int pos)
        Returns true if the argument at this given position is a double, false otherwise. You can retrieve the value with getDoubleArgument(int).
        Parameters:
        pos - Position in the argument list.
        Returns:
        True if the argument at this given position is a double.
      • getIntReturnValue

        public long getIntReturnValue()
        Returns the return value of this evaluation point. Only allowed if the external function associated with this evaluation point is an integer function.
        Returns:
        Return value of this point.
      • getDoubleReturnValue

        public double getDoubleReturnValue()
        Returns the return value of this evaluation point. Only allowed if the external function associated with this evaluation point is a double function.
        Returns:
        Return value of this point.
      • getArrayReturnValue

        public LSArray getArrayReturnValue()
        Returns the return value of this evaluation point. Only allowed if the external function associated with this evaluation point is an array function.
        Returns:
        Return value of this point.
      • getIntArgument

        public long getIntArgument​(int pos)
        Returns the value of the argument at the given position. Only allowed if this argument is an integer or a boolean.
        Parameters:
        pos - Position in the argument list.
        Returns:
        Value of the argument.
      • getDoubleArgument

        public double getDoubleArgument​(int pos)
        Returns the value of the argument at the given position. Only allowed if this argument is a double.
        Parameters:
        pos - Position in the argument list.
        Returns:
        Value of the argument.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object