Class VariableTrace

All Implemented Interfaces:
RemoveLevelLate, UsesQueueVariable

public class VariableTrace extends Constraint implements UsesQueueVariable, RemoveLevelLate
VariableTrace is a daemon that prints information on variables whenever they are changed.
Version:
4.9
  • Field Details

  • Constructor Details

    • VariableTrace

      public VariableTrace(Var v)
      It constructs trace daemon for variable v
      Parameters:
      v - variable to be traced
    • VariableTrace

      public VariableTrace(Var[] vs)
      It constructs trace daemon for variables vs
      Parameters:
      vs - variables to be traced
    • VariableTrace

      public VariableTrace(List<Var> vs)
      It constructs trace daemon for variables vs
      Parameters:
      vs - variables to be traced
  • Method Details

    • impose

      public void impose(Store store)
      Description copied from class: Constraint
      It imposes the constraint in a given store.
      Overrides:
      impose in class Constraint
      Parameters:
      store - the constraint store to which the constraint is imposed to.
    • consistency

      public void consistency(Store store)
      Description copied from class: Constraint
      It is a (most probably incomplete) consistency function which removes the values from variables domains. Only values which do not have any support in a solution space are removed.
      Specified by:
      consistency in class Constraint
      Parameters:
      store - constraint store within which the constraint consistency is being checked.
    • getDefaultConsistencyPruningEvent

      public int getDefaultConsistencyPruningEvent()
      Specified by:
      getDefaultConsistencyPruningEvent in class Constraint
    • queueVariable

      public void queueVariable(int level, Var var)
      Description copied from class: Constraint
      This is a function called to indicate which variable in a scope of constraint has changed. It also indicates a store level at which the change has occurred.
      Overrides:
      queueVariable in class Constraint
      Parameters:
      level - the level of the store at which the change has occurred.
      var - variable which has changed.
    • removeLevelLate

      public void removeLevelLate(int level)
      Description copied from interface: RemoveLevelLate
      This function is called in case of the backtrack. It is called after all timestamps, variables, mutablevariables have reverted to their values *after* removing the level.
      Specified by:
      removeLevelLate in interface RemoveLevelLate
      Parameters:
      level - the level which is being removed.
    • removeConstraint

      public void removeConstraint()
      Description copied from class: Constraint
      It removes the constraint by removing this constraint from all variables.
      Overrides:
      removeConstraint in class Constraint
    • satisfied

      public boolean satisfied()
    • toString

      public String toString()
      Description copied from class: Constraint
      It produces a string representation of a constraint state.
      Overrides:
      toString in class Constraint
    • increaseWeight

      public void increaseWeight()
      Description copied from class: Constraint
      It increases the weight of the variables in the constraint scope.
      Overrides:
      increaseWeight in class Constraint