Uploaded image for project: 'Sat4j'
  1. Sat4j
  2. SAT-40

Random Walk Decorator disable Objective Function based heuristics

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.2.3, 2.3.0
    • Fix Version/s: 2.3.1
    • Component/s: pseudo
    • Security Level: Public (Everybody can see)
    • Labels:
      None

      Description

      It is possible to add random walks in the solver using the RandomWalkDecorator class, by using e.g.

      mysolver.setOrder(new RandomWalkDecorator(new VarOrderHeap(),0.005);

      It works fine for SAT solvers, however, there is an issue when working with PB solvers, which use a heuristics taking into account the objective function.

      The current implementation of PBSolver breaks the Liskov Substitution Principle because there is an instanceof statement in the PBSolver.setObjectiveFunction() method referring to a concrete class.

      As such, using a decorator, the objective function is not passed to the VarOrderObjective object.

      The solution is to fix properly the LSP issue by:

      • creating an IOrderObjective interface to catch the capability to manage the objective function in a heuristics.
      • use that interface in PBSolver in the instanceof statement.
      • make the VarOrderObjective implement that interface.
      • create a subclass of RandomWaldDecorator that implement that interface.

        Activity

        Hide
        leberre Daniel Le Berre added a comment -

        Fixed in r1055.

        Show
        leberre Daniel Le Berre added a comment - Fixed in r1055.

          People

          • Assignee:
            leberre Daniel Le Berre
            Reporter:
            leberre Daniel Le Berre
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: