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.extension
Class Extension

    java.lang.Object
      ifs.extension.Extension

All Implemented Interfaces:
  ModelListener

Direct Known Subclasses:
  ConflictStatistics, MacPropagation, ViolatedInitials

    public class Extension

extends Object
implements ModelListener

Generic extension of IFS solver.
All extensions should extend this class.
An extension may use extra information associated with a variable or a value (see `Variable.setExtra(Object)`, `Variable.getExtra()`, `Value.setExtra(Object)`, `Value.getExtra()`) but there can be only one extension using these extra objects used during the search. For instance, `MacPropagation` is using these extra objects to memorize explanations.

Version:
  1.0
Author:
  Tomáš Müller

Constructor Summary
`Extension(Solver solver, DataProperties properties)` Constructor

Method Summary
`void` | `afterAssigned(long iteration, Value value)` Called after a value is assigned to a variable
`void` | `afterUnassigned(long iteration, Value value)` Called after a value is unassigned from a variable
`void` | `beforeAssigned(long iteration, Value value)` Called before a value is assigned to a variable
`void` | `beforeUnassigned(long iteration, Value value)` Called after a value is unassigned from a variable
`void` | `constraintAdded(Constraint constraint)` Called when a constraint is added to the model
`void` | `constraintRemoved(Constraint constraint)` Called when a constraint is removed from the model
`void` | `getInfo(Hashtable anInfo)` Put some information from the extension to the solution info table
`Model` | `getModel()` Returns the model
`DataProperties` | `getProperties()` Returns input configuration
`Solver` | `getSolver()` Returns the solver
`boolean` | `init(Solver solver)` Initialization -- called before the solver is started
`boolean` | `isRegistered()` Returns true if there is a model registered to this extension, i.e., when extension is registered.
`void` | `register(Model model)` Registration of a model.
`void` | `unregister(Model model)` Unregistration of a model.
`boolean` | `useValueExtra()` Should return true when `Value.setExtra(Object)`, `Value.getExtra()` are used by the extension
`boolean` | `useVariableExtra()` Should return true when `Variable.setExtra(Object)`, `Variable.getExtra()` are used by the extension
`void` | `variableAdded(Variable variable)` Called when a variable is added to the model
`void` | `variableRemoved(Variable variable)` Called when a variable is removed from the model

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

Constructor Detail

### Extension

    public Extension(Solver solver,
                     DataProperties properties)

  Constructor

  Parameters:
    `solver` - IFS solver
    `properties` - input configuration

Method Detail

### register

    public void register(Model model)

  Registration of a model. This is called by the solver before start.

### unregister

    public void unregister(Model model)

  Unregistration of a model. This is called by the solver when extension is removed.

### isRegistered

    public boolean isRegistered()

  Returns true if there is a model registered to this extension, i.e., when extension is registered.

### getModel

    public Model getModel()

  Returns the model

### getSolver

    public Solver getSolver()

  Returns the solver

### getProperties

    public DataProperties getProperties()

  Returns input configuration

### afterAssigned

    public void afterAssigned(long iteration,
                              Value value)

  Called after a value is assigned to a variable

  Specified by:
    `afterAssigned` in interface `ModelListener`
  Parameters:
    `iteration` - current iteration
    `value` - value to be assigned

### afterUnassigned

    public void afterUnassigned(long iteration,
                                Value value)

  Called after a value is unassigned from a variable

  Specified by:
    `afterUnassigned` in interface `ModelListener`
  Parameters:
    `iteration` - current iteration
    `value` - value to be unassigned

### beforeAssigned

    public void beforeAssigned(long iteration,
                               Value value)

  Called before a value is assigned to a variable

  Specified by:
    `beforeAssigned` in interface `ModelListener`
  Parameters:
    `iteration` - current iteration
    `value` - value to be assigned

### beforeUnassigned

    public void beforeUnassigned(long iteration,
                                 Value value)

  Called after a value is unassigned from a variable

  Specified by:
    `beforeUnassigned` in interface `ModelListener`
  Parameters:
    `iteration` - current iteration
    `value` - value to be unassigned

### constraintAdded

    public void constraintAdded(Constraint constraint)

  Called when a constraint is added to the model

  Specified by:
    `constraintAdded` in interface `ModelListener`
  Parameters:
    `constraint` - added constraint

### constraintRemoved

    public void constraintRemoved(Constraint constraint)

  Called when a constraint is removed from the model

  Specified by:
    `constraintRemoved` in interface `ModelListener`
  Parameters:
    `constraint` - removed constraint

### variableAdded

    public void variableAdded(Variable variable)

  Called when a variable is added to the model

  Specified by:
    `variableAdded` in interface `ModelListener`
  Parameters:
    `variable` - added variable

### variableRemoved

    public void variableRemoved(Variable variable)

  Called when a variable is removed from the model

  Specified by:
    `variableRemoved` in interface `ModelListener`
  Parameters:
    `variable` - removed variable

### getInfo

    public void getInfo(Hashtable anInfo)

  Put some information from the extension to the solution info table

  Specified by:
    `getInfo` in interface `ModelListener`
  Parameters:
    `anInfo` - resultant table with informations (key, value).

### init

    public boolean init(Solver solver)

  Initialization -- called before the solver is started

  Specified by:
    `init` in interface `ModelListener`
  Parameters:
    `solver` - IFS solver

### useValueExtra

    public boolean useValueExtra()

  Should return true when `Value.setExtra(Object)`, `Value.getExtra()` are used by the extension

### useVariableExtra

    public boolean useVariableExtra()

  Should return true when `Variable.setExtra(Object)`, `Variable.getExtra()` are used by the extension

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