Interface IterationCallback<S extends Solution<S>>

Type Parameters:
S - the solution type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface IterationCallback<S extends Solution<S>>
Observes completed ALNS iterations synchronously on the search thread.

Callbacks run after selector feedback and statistics collection, independently of whether statistics are enabled. Exceptions propagate to the caller of Alns.solve(S, io.github.nhtc2005.alns.acceptance.AcceptanceCriterion<S>, io.github.nhtc2005.alns.stopping.StoppingCriterion<S>).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Receives the state after a completed iteration.
  • Method Details

    • onIteration

      void onIteration(IterationContext<S> context)
      Receives the state after a completed iteration.

      Solutions must not be modified. Copy them before retaining them or using them on another thread. Callback time is included in total search time, but excluded from iteration statistics.

      Parameters:
      context - the non-null completed iteration context