Interface DeltaEnergyMove<S extends AnnealingSolution<S>>

Type Parameters:
S - solution type
All Superinterfaces:
AnnealingMove<S>, ReversibleAnnealingMove<S>
All Known Implementing Classes:
TspMove

public interface DeltaEnergyMove<S extends AnnealingSolution<S>> extends ReversibleAnnealingMove<S>
Optional interface for annealing moves that can provide an O(1) (or cheap) energy difference (ΔE) for the proposed move.

A DeltaEnergyMove must ensure that the ΔE returned by deltaE(AnnealingSolution) corresponds to the same move that will be performed by ReversibleAnnealingMove.apply(AnnealingSolution).

To support this, the annealer will call prepare(AnnealingSolution) once per step before requesting ΔE and applying the move. Implementations should choose their random parameters in prepare and then reuse them in both deltaE and apply.

  • Method Summary

    Modifier and Type
    Method
    Description
    double
    deltaE(S solution)
    Compute the change in energy if this prepared move were applied.
    default void
    prepare(S solution)
    Prepare the move for evaluation and application.

    Methods inherited from interface edu.cnu.mdi.sim.simanneal.ReversibleAnnealingMove

    apply, undo
  • Method Details

    • prepare

      default void prepare(S solution)
      Prepare the move for evaluation and application.

      This is called once per annealing step before deltaE(S) and ReversibleAnnealingMove.apply(S). Implementations typically choose random indices or other parameters here.

      Parameters:
      solution - the current solution (non-null)
    • deltaE

      double deltaE(S solution)
      Compute the change in energy if this prepared move were applied.

      Must be consistent with the subsequent call to ReversibleAnnealingMove.apply(S).

      Parameters:
      solution - the current solution (non-null)
      Returns:
      energy change (new - old)