Class AbstractEventObserver

  • Direct Known Subclasses:
    EventRecorder

    public abstract class AbstractEventObserver
    extends Object
    An abstract class for event recording utility.

    Created by cprudhom on 09/12/14. Project: choco.

    • Field Detail

      • SILENT_OBSERVER

        public static final AbstractEventObserver SILENT_OBSERVER
        A default observer that does nothing on events
    • Constructor Detail

      • AbstractEventObserver

        public AbstractEventObserver()
    • 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.
        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.

        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.

        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.
        Parameters:
        var - an integer variable
        val - a value
        cause - a cause
        oldLB - previous lb
        oldUB - previous ub
      • pushDecisionLevel

        public void pushDecisionLevel()
      • undo

        public void undo()
        Undo the last operation done