Package edu.cnu.mdi.sim.simanneal
Interface DeltaEnergyMove<S extends AnnealingSolution<S>>
- Type Parameters:
S- solution type
- All Superinterfaces:
AnnealingMove<S>,ReversibleAnnealingMove<S>
- All Known Implementing Classes:
TspMove
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
Methods inherited from interface edu.cnu.mdi.sim.simanneal.ReversibleAnnealingMove
apply, undo
-
Method Details
-
prepare
Prepare the move for evaluation and application.This is called once per annealing step before
deltaE(S)andReversibleAnnealingMove.apply(S). Implementations typically choose random indices or other parameters here.- Parameters:
solution- the current solution (non-null)
-
deltaE
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)
-