Class SatChangesListener

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      clears all sets, so that elements occurring in them later result only from later events
      void ensureAccess​(IntVar cpVar)
      gets sure we won't have a NullPointerException
      void initialize​(Core core)
      initializes the component with the given solver.
      void initialize​(SatWrapper wrapper)  
      private void onAssertion​(int literal)
      this should be called every time a new boolean variable representing a CP proposition is asserted, but preferably only once per variable, so that it can later update the CP variables domains
      void onAssertion​(int literal, int level)
      Called when a variable is set
      void onBackjump​(int oldLevel, int newLevel)
      clear on backjump
      void onPropagate​(int literal, int clauseId)
      called when a propagation occurs
      void onRestart​(int oldLevel)
      called when the solver restarts.
      java.lang.String toString()  
      void updateCpVariables​(int storeLevel)
      Using all data accumulated since last clear(), update the domain of the given CP variable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • core

        private Core core
      • excludedValues

        private java.util.Set<java.lang.Integer>[] excludedValues
      • upperBounds

        private java.lang.Integer[] upperBounds
      • lowerBounds

        private java.lang.Integer[] lowerBounds
      • intVarsToUpdate

        private java.util.BitSet intVarsToUpdate
      • booleanVarsToUpdate

        private java.util.Set<BooleanVar> booleanVarsToUpdate
    • Constructor Detail

      • SatChangesListener

        public SatChangesListener()
    • Method Detail

      • clear

        public void clear()
        clears all sets, so that elements occurring in them later result only from later events
      • onPropagate

        public void onPropagate​(int literal,
                                int clauseId)
        Description copied from interface: PropagateListener
        called when a propagation occurs
        Specified by:
        onPropagate in interface PropagateListener
        Parameters:
        literal - the literal propagated
        clauseId - the unique ID of the unit clause
      • onAssertion

        public void onAssertion​(int literal,
                                int level)
        Description copied from interface: AssertionListener
        Called when a variable is set
        Specified by:
        onAssertion in interface AssertionListener
        Parameters:
        literal - the literal that is set propagation, false otherwise
        level - the search level
      • onBackjump

        public void onBackjump​(int oldLevel,
                               int newLevel)
        clear on backjump
        Specified by:
        onBackjump in interface BackjumpListener
        Parameters:
        oldLevel - the level at which the solver was before backtracking
        newLevel - the level to which the solver backtracks
      • onRestart

        public void onRestart​(int oldLevel)
        Description copied from interface: BackjumpListener
        called when the solver restarts.

        components that want to be warned about restarts should put themselves in Core.restartModules.

        Specified by:
        onRestart in interface BackjumpListener
        Parameters:
        oldLevel - the level at which the solver was before restarting
      • onAssertion

        private void onAssertion​(int literal)
        this should be called every time a new boolean variable representing a CP proposition is asserted, but preferably only once per variable, so that it can later update the CP variables domains
        Parameters:
        literal - the boolean literal that has been asserted
      • updateCpVariables

        public void updateCpVariables​(int storeLevel)
        Using all data accumulated since last clear(), update the domain of the given CP variable
        Parameters:
        storeLevel - the current level of the store
      • ensureAccess

        public void ensureAccess​(IntVar cpVar)
        gets sure we won't have a NullPointerException
        Parameters:
        cpVar - the CP variable we are about to access
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • initialize

        public void initialize​(Core core)
        Description copied from interface: SolverComponent
        initializes the component with the given solver. May be called only once. This method must register the component to the solver for the run.
        Specified by:
        initialize in interface SolverComponent
        Parameters:
        core - core component to initialize
      • initialize

        public void initialize​(SatWrapper wrapper)