Interface SolverModelEnrichmentDirector<SolverModel_ extends SolverModel<? extends ai.timefold.solver.core.api.score.Score<?>>>

All Superinterfaces:
SolverModelEnrichmentDirectorBase

public non-sealed interface SolverModelEnrichmentDirector<SolverModel_ extends SolverModel<? extends ai.timefold.solver.core.api.score.Score<?>>> extends SolverModelEnrichmentDirectorBase
Provides a model-specific way of enriching a solver model, typically for models using multiple enrichers depending on each other.

While the implementation typically injects a list of available enrichers SolverModelEnricherBase, it may use none, any or all of them. The implementation can (and should) avoid traversing the same parts of the model by different enrichers.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    accepts(SolverModel_ solverModel)
    Returns true if this enrichment director is able to enrich the given model.
    enrich(SolverModel_ solverModel)
    Enriches given solver model content based on additional requirements specific for that particular model, such as filling in calculated distances for locations.
  • Method Details

    • accepts

      default boolean accepts(SolverModel_ solverModel)
      Returns true if this enrichment director is able to enrich the given model.

      The default implementation checks the model is not null.

      Parameters:
      solverModel - the solver model to check for compatibility with this director
      Returns:
      true, if the given model can be enriched by this director, false otherwise
    • enrich

      SolverModel_ enrich(SolverModel_ solverModel)
      Enriches given solver model content based on additional requirements specific for that particular model, such as filling in calculated distances for locations.
      Parameters:
      solverModel - the solver model to be enriched, never null
      Returns:
      enriched solverModel - never null