Class ImpactBased

    • Constructor Detail

      • ImpactBased

        public ImpactBased​(IntVar[] ivariables,
                           int alpha,
                           int split,
                           int nodeImpact,
                           long seed,
                           boolean initOnly)
        Create an Impact-based search strategy with Node Impact strategy.

        "Impact-Based Search Strategies for Constraint Programming", Philippe Refalo, CP2004.

        ivariables - variables of the problem (should be integers)
        alpha - aging parameter
        split - split parameter for subdomains computation
        nodeImpact - force update of impacts every nodeImpact nodes. Set value to 0 to avoid using it.
        seed - a seed for random
        initOnly - only apply the initialisation phase, do not update impact thereafter
      • ImpactBased

        public ImpactBased​(IntVar[] vars,
                           boolean initOnly)
    • Method Detail

      • computeDecision

        public Decision<IntVar> computeDecision​(IntVar 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
        computeDecision in class AbstractStrategy<IntVar>
        variable - a variable
        a decision to be applied to variable var
      • setInitialisationTimeLimit

        public void setInitialisationTimeLimit​(long timeLimit)
        Define a time limit on initialisation phase. When the limit is reached, computing impacts on ROOT node stops and the search can start.
        timeLimit - in milliseconds
      • setReevaluationTimeLimit

        public void setReevaluationTimeLimit​(long timeLimit)
        Define a time limit on reevaluation phase (done every nodeImpact nodes). When the limit is reached, reevaluting impacts stops and the search can go on.
        timeLimit - in milliseconds
      • 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
        init in class AbstractStrategy<IntVar>
      • afterDownBranch

        public void afterDownBranch​(boolean left)
        Description copied from interface: IMonitorDownBranch
        Action to perform after going down in the tree search
        Specified by:
        afterDownBranch in interface IMonitorDownBranch
        left - set to true to specify that this is a left branch