Class EventRecorder


  • public class EventRecorder
    extends AbstractEventObserver
    An explanation engine that learns general constraint from failures.

    Project: choco-solver.

    Since:
    25/01/2017.
    Author:
    Charles Prud'homme
    • Constructor Detail

      • EventRecorder

        public EventRecorder​(Solver solver)
        Create an explanation engine which is able to learn general constraint on conflict
        Parameters:
        solver - solver this class relies on
    • Method Detail

      • removeValue

        public void removeValue​(IntVar var,
                                int val,
                                ICause cause)
        Explain the removal of the val from var, due to cause. This is the main explanation why we create this class. Record operations to execute for explicit call to explanation.
        Overrides:
        removeValue in class AbstractEventObserver
        Parameters:
        var - an integer variable
        val - a value
        cause - a cause
      • updateLowerBound

        public void updateLowerBound​(IntVar var,
                                     int value,
                                     int old,
                                     ICause cause)
        Explain the removal of [old,value[ from var, due to cause.

        Prerequisite: value should belong to var This is the main reason why we create this class. Record operations to execute for explicit call to explanation.

        Overrides:
        updateLowerBound in class AbstractEventObserver
        Parameters:
        var - an integer variable
        value - a value
        cause - a cause
      • updateUpperBound

        public void updateUpperBound​(IntVar var,
                                     int value,
                                     int old,
                                     ICause cause)
        Explain the removal of ]value,old] from var, due to cause.

        Prerequisite: value should belong to var This is the main reason why we create this class. Record operations to execute for explicit call to explanation.

        Overrides:
        updateUpperBound in class AbstractEventObserver
        Parameters:
        var - an integer variable
        value - a value
        cause - a cause
      • instantiateTo

        public void instantiateTo​(IntVar var,
                                  int val,
                                  ICause cause,
                                  int oldLB,
                                  int oldUB)
        Explain the assignment to val of var due to cause. This is the main reason why we create this class. Record operations to execute for explicit call to explanation.
        Overrides:
        instantiateTo in class AbstractEventObserver
        Parameters:
        var - an integer variable
        val - a value
        cause - a cause
        oldLB - previous lb
        oldUB - previous ub