Class MoveBinaryLDS

  • All Implemented Interfaces:
    Move
    Direct Known Subclasses:
    MoveBinaryDDS

    public class MoveBinaryLDS
    extends MoveBinaryDFS
    A move dedicated to run an Limited Discrepancy Search[1] (LDS) with binary decisions.

    [1]:W.D. Harvey and M.L.Ginsberg, Limited Discrepancy Search, IJCAI-95.

    Created by cprudhom on 07/10/15. Project: choco.

    Since:
    07/10/15
    Author:
    Charles Prud'homme
    • Field Detail

      • dis

        protected IStateInt dis
        current discrepancy, maintained incrementally
      • DIS

        protected int DIS
        max discrepancy allowed
    • Constructor Detail

      • MoveBinaryLDS

        public MoveBinaryLDS​(AbstractStrategy strategy,
                             int discrepancy,
                             IEnvironment environment)
        Create a DFS with binary decisions
        Parameters:
        strategy - how (binary) decisions are selected
        discrepancy - maximum discrepancy
        environment - backtracking environment
    • Method Detail

      • init

        public boolean init()
        Description copied from interface: Move
        Called before the search starts. Also initializes the search strategy.
        Specified by:
        init in interface Move
        Overrides:
        init in class MoveBinaryDFS
        Returns:
        false if something goes wrong, true otherwise
      • repair

        public boolean repair​(Solver solver)
        Description copied from interface: Move
        Performs a move when the CSP associated to the current node of the search space is proven to be not consistent.
        Specified by:
        repair in interface Move
        Overrides:
        repair in class MoveBinaryDFS
        Parameters:
        solver - reference the solver
        Returns:
        true if a reparation can be done, false when no more reparation is possible.
      • rewind

        protected boolean rewind​(Solver solver)
        Description copied from class: MoveBinaryDFS
        Go back in the search tree. Either refute a decision, or backtrack.
        Overrides:
        rewind in class MoveBinaryDFS
        Parameters:
        solver - reference to the solver
        Returns:
        true if a reparation has been found