Class AbstractStrategy<V extends Variable>

    • Field Detail

      • vars

        protected final V extends Variable[] vars
    • Constructor Detail

      • AbstractStrategy

        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.
        the current decision
      • toString

        public String toString()
        Creates a String object containing a pretty print of the current variables.
        toString in class Object
        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
        var - a variable
        a decision to be applied to variable var
      • getVariables

        public V[] getVariables()
        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);
        var - variable to branch on
        val - value to branch on
        an assignment decision object (var = val) for integer variables