Class SetStrategy


  • public class SetStrategy
    extends AbstractStrategy<SetVar>
    Strategy for branching on set variables
    Since:
    6/10/13
    Author:
    Jean-Guillaume Fages
    • Constructor Detail

      • SetStrategy

        public SetStrategy​(SetVar[] scope,
                           VariableSelector<SetVar> varS,
                           SetValueSelector valS,
                           boolean enforceFirst)
        Generic strategy to branch on set variables
        Parameters:
        scope - SetVar array to branch on
        varS - variable selection strategy
        valS - integer selection strategy
        enforceFirst - branching order true = enforce first; false = remove first
    • 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<SetVar>
      • computeDecision

        public Decision<SetVar> computeDecision​(SetVar s)
        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<SetVar>
        Parameters:
        s - a variable
        Returns:
        a decision to be applied to variable var