# AbstractAlgorithm (ARX Developer Documentation)

org.deidentifier.arx.algorithm

## Class AbstractAlgorithm

- java.lang.Object
- - org.deidentifier.arx.algorithm.AbstractAlgorithm

- Direct Known Subclasses:
    FLASHAlgorithmImpl, LIGHTNINGAlgorithm

      public abstract class AbstractAlgorithm
      extends java.lang.Object

  Abstract class for an algorithm, which provides some generic methods.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected NodeChecker` | `checker` A node checker.
    `protected SolutionSpace` | `solutionSpace` The lattice.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractAlgorithm(SolutionSpace solutionSpace, NodeChecker checker)` Walks the lattice.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `computeUtilityForMonotonicMetrics(Transformation transformation)` Determine information loss of the given node if it can be used for estimating minimum and maximum information loss for tagged nodes.
    `Transformation` | `getGlobalOptimum()` Returns the global optimum.
    `protected void` | `progress(double progress)` Propagate progress to listeners
    `void` | `setListener(ARXListener listener)` Sets a listener
    `protected void` | `trackOptimum(Transformation transformation)` Keeps track of the global optimum.
    `abstract void` | `traverse()` Implement this method in order to provide a new algorithm.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### checker

          protected NodeChecker checker

      A node checker.

    - #### solutionSpace

          protected SolutionSpace solutionSpace

      The lattice.

  - ### Constructor Detail

    - #### AbstractAlgorithm

          protected AbstractAlgorithm(SolutionSpace solutionSpace,
                           NodeChecker checker)

      Walks the lattice.
      Parameters:
        `solutionSpace` - The solution space
        `checker` - The checker

  - ### Method Detail

    - #### getGlobalOptimum

          public Transformation getGlobalOptimum()

      Returns the global optimum.
      Returns:

    - #### setListener

          public void setListener(ARXListener listener)

      Sets a listener
      Parameters:
        `listener` -

    - #### traverse

          public abstract void traverse()

      Implement this method in order to provide a new algorithm.

    - #### computeUtilityForMonotonicMetrics

          protected void computeUtilityForMonotonicMetrics(Transformation transformation)

      Determine information loss of the given node if it can be used for estimating minimum and maximum information loss for tagged nodes.
      Parameters:
        `transformation` -

    - #### progress

          protected void progress(double progress)

      Propagate progress to listeners
      Parameters:
        `progress` -

    - #### trackOptimum

          protected void trackOptimum(Transformation transformation)

      Keeps track of the global optimum.
      Parameters:
        `transformation` -