Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ifs.dbt
Class DbtPropagation

    java.lang.Object
      ifs.extension.Extension
          ifs.extension.MacPropagation
              ifs.dbt.DbtPropagation

All Implemented Interfaces:
  ModelListener, SolverListener

    public class DbtPropagation

extends MacPropagation
implements SolverListener

Maintenance of arc consistency in dynamic backtracking.
The difference between `MacPropagation` and this DBT propagation is that all not-assigned values of an assigned variable are marked as nogood. Also, when a dead end is reached, unassignment or failure takes place.
This IFS solver extension is to be used only in case of dynamic backtracking and it has no parameters.

Version:
  1.0
Author:
  Tomáš Müller

Field Summary

Fields inherited from class ifs.extension.MacPropagation
`iConstraints, iIteration`

Constructor Summary
`DbtPropagation(Solver solver, DataProperties properties)` Constructor.

Method Summary
`void` | `afterAssigned(long iteration, Value value)` Propagation takes place every time a value is assigned to a variable.
`void` | `afterUnassigned(long iteration, Value value)` Undo propagation when a value is unassigned.
`boolean` | `valueSelected(long iteration, Variable variable, Value value)` If no value is selected (because of a dead end), make some unassignments.
`boolean` | `variableSelected(long iteration, Variable variable)` If no variable is selected (all variables are assinged), unassign the last assigned variable.

Methods inherited from class ifs.extension.MacPropagation
`addConstraint, beforeAssigned, contains, goodValues, init, isGood, noGood, propagate, propagate, propagate, propagate, setGood, setNoGood, undoPropagate`

Methods inherited from class ifs.extension.Extension
`beforeUnassigned, constraintAdded, constraintRemoved, getInfo, getModel, getProperties, getSolver, isRegistered, register, unregister, useValueExtra, useVariableExtra, variableAdded, variableRemoved`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DbtPropagation

    public DbtPropagation(Solver solver,
                          DataProperties properties)

  Constructor. No parameter is taken from properties.

Method Detail

### afterAssigned

    public void afterAssigned(long iteration,
                              Value value)

  Propagation takes place every time a value is assigned to a variable.
  - Prints a warning if the value is nogood (should not never happen),
  - sets all other values of the variable to nogood (explanation is the assigned value itself),
  - runs propagation.

  Specified by:
    `afterAssigned` in interface `ModelListener`
  Overrides:
    `afterAssigned` in class `MacPropagation`
  Parameters:
    `iteration` - current iteration
    `value` - value to be assigned
  See Also:
    `MacPropagation.propagate(Variable)`

### afterUnassigned

    public void afterUnassigned(long iteration,
                                Value value)

  Undo propagation when a value is unassigned.
  - Prints an error if the value is nogood (should not never happen),
  - runs propagation undo.

  Specified by:
    `afterUnassigned` in interface `ModelListener`
  Overrides:
    `afterUnassigned` in class `MacPropagation`
  Parameters:
    `iteration` - current iteration
    `value` - value to be unassigned
  See Also:
    `MacPropagation.undoPropagate(Variable)`

### variableSelected

    public boolean variableSelected(long iteration,
                                    Variable variable)

  If no variable is selected (all variables are assinged), unassign the last assigned variable.
  Do not allow to select an assigned variable.
  If no variable is selected (because all variables are assigned, see `DbtVariableSelection`):
  - find the last assigned variable and
  - unassign it (explanation is a union of assignments of all other variables).

  Specified by:
    `variableSelected` in interface `SolverListener`
  Parameters:
    `iteration` - current iteration
    `variable` - selected variable
  See Also:
    `DbtVariableSelection.selectVariable(Solution)`

### valueSelected

    public boolean valueSelected(long iteration,
                                 Variable variable,
                                 Value value)

  If no value is selected (because of a dead end), make some unassignments.
  If no value is selected (e.g., because the selected variable has all values marked as nogood, see `DbtValueSelection`),
  - compute a union of explanations of all values,
    - if it is empty fail (inconsistency is found),
  - otherwise pick the last assigned variable from the computed union of explanation and unassign it
    (explanation for that is the computed union of explanations without the last assignment).

  Specified by:
    `valueSelected` in interface `SolverListener`
  Parameters:
    `iteration` - current iteration
    `variable` - selected variable
    `value` - selected variable
  See Also:
    `DbtVariableSelection.selectVariable(Solution)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Tomáš Müller