Interface SolutionKey<K,S extends Solution<S>>

Type Parameters:
K - the key type
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 SolutionKey<K,S extends Solution<S>>
Extracts a key identifying a solution's structure, independently of its objective value.
  • Method Summary

    Modifier and Type
    Method
    Description
    keyOf(S solution)
    Returns a key without modifying the solution.
  • Method Details

    • keyOf

      K keyOf(S solution)
      Returns a key without modifying the solution.

      Key equality must represent solution identity. The key's equality and hash code must remain stable while stored; snapshot mutable solution data rather than returning a live reference.

      Parameters:
      solution - the non-null solution to identify
      Returns:
      a non-null key with stable equals and hashCode behavior