Interface DynamicStrategyIdProvider
- All Known Implementing Classes:
IndependentRuinAndRecreateModule
public interface DynamicStrategyIdProvider
Interface for search strategy modules that provide dynamic strategy IDs.
Modules implementing this interface can provide a strategy ID that reflects
the actual operators used in the last execution. This is useful for modules
like IndependentRuinAndRecreateModule
that select operators dynamically at each iteration.
The SearchStrategy will check if a module implements this interface
and use the dynamic ID when reporting to StrategySelectedListener.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the strategy ID for the last execution.
-
Method Details
-
getLastExecutionStrategyId
String getLastExecutionStrategyId()Returns the strategy ID for the last execution.This method is called after
SearchStrategyModule.runAndGetSolution(com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution)completes, so implementations should return the ID reflecting the operators that were actually used.- Returns:
- the dynamic strategy ID, e.g., "independent:radial+regretFast"
-