Class OptimizeVar


  • public class OptimizeVar
    extends ObjectiveMonitor
    This class encapsulates an objective. It requires the direction
    (minimize or maximize), the variable to optimize, and the
    improvement step.
    • Constructor Detail

      • OptimizeVar

        protected OptimizeVar​(long cPtr,
                              boolean cMemoryOwn)
      • OptimizeVar

        public OptimizeVar​(Solver solver,
                           boolean maximize,
                           IntVar var,
                           long step)
    • Method Detail

      • getCPtr

        protected static long getCPtr​(OptimizeVar obj)
      • swigRelease

        protected static long swigRelease​(OptimizeVar obj)
      • best

        public long best()
        Returns the best value found during search.
      • var

        public IntVar var()
        Returns the variable that is optimized.
      • atSolution

        public boolean atSolution()
        Description copied from class: SearchMonitor
        This method is called when a valid solution is found. If the
        return value is true, then search will resume after. If the result
        is false, then search will stop there.
        Overrides:
        atSolution in class ObjectiveMonitor
      • acceptSolution

        public boolean acceptSolution()
        Description copied from class: SearchMonitor
        This method is called when a solution is found. It asserts whether the
        solution is valid. A value of false indicates that the solution
        should be discarded.
        Overrides:
        acceptSolution in class SearchMonitor
      • Name

        public java.lang.String Name()
      • applyBound

        public void applyBound()