Class AbstractStrategy<V extends Variable>

    • Field Detail

      • vars

        protected final V extends Variable[] vars
    • Constructor Detail

      • AbstractStrategy

        @SafeVarargs
        protected AbstractStrategy​(V... variables)
    • Method Detail

      • init

        public boolean init()
        Prepare this to be used in a search loop The initialization can detect inconsistency, in that case, it returns false
      • remove

        public void remove()
        Remove the current strategy. This implies unplugging variable or search monitors.
      • getDecision

        public abstract Decision<V> getDecision()
        Provides access to the current decision in the strategy. If there are no more decision to provide, it returns null.
        Returns:
        the current decision
      • toString

        public String toString()
        Creates a String object containing a pretty print of the current variables.
        Overrides:
        toString in class Object
        Returns:
        a String object
      • computeDecision

        protected Decision<V> computeDecision​(V var)
        Computes a decision to be applied to variable var This method should be implemented in order to use search patterns
        Parameters:
        var - a variable
        Returns:
        a decision to be applied to variable var
      • getVariables

        public V[] getVariables()
        Returns:
        array of variables
      • makeIntDecision

        protected final IntDecision makeIntDecision​(IntVar var,
                                                    int val)
        Creates an assignment decision object for integer variables Just a simple shortcut for : solver.getDecisionPath().makeIntDecision(var,DecisionOperatorFactory.makeIntEq(),val);
        Parameters:
        var - variable to branch on
        val - value to branch on
        Returns:
        an assignment decision object (var = val) for integer variables