Class StrategiesSequencer


  • public class StrategiesSequencer
    extends AbstractStrategy<Variable>
    A StrategiesSequencer is class for AbstractStrategy composition. this is created with a list of AbstractStrategy, and calling getDecision() retrieves the current active AbstractStrategy and calls the delegate getDecision() method.
    A AbstractStrategy becomes "inactive" when no more decision can be computed, ie every decisions have been computed and used.
    Since:
    5 juil. 2010
    Author:
    Charles Prud'homme
    • Method Detail

      • init

        public boolean init()
        Description copied from class: AbstractStrategy
        Prepare this to be used in a search loop The initialization can detect inconsistency, in that case, it returns false
        Overrides:
        init in class AbstractStrategy<Variable>
      • computeDecision

        public Decision<Variable> computeDecision​(Variable variable)
        Description copied from class: AbstractStrategy
        Computes a decision to be applied to variable var This method should be implemented in order to use search patterns
        Overrides:
        computeDecision in class AbstractStrategy<Variable>
        Parameters:
        variable - a variable
        Returns:
        a decision to be applied to variable var
      • getDecision

        public Decision getDecision()
        Provides access to the current decision in the strategy. If there are no more decision to provide, it returns null. Iterates over the declared sub-strategies and gets the overall current decision.
        Specified by:
        getDecision in class AbstractStrategy<Variable>
        Returns:
        the current decision
      • toString

        public String toString()
        Creates a String object containing a pretty print of the current variables. This is based on the print() method of every sub-strategies.
        Overrides:
        toString in class AbstractStrategy<Variable>
        Returns:
        a String object