Class AStarSolver<T>

java.lang.Object
org.ddolib.astar.core.solver.AStarSolver<T>
All Implemented Interfaces:
Solver

public final class AStarSolver<T> extends Object implements Solver
  • Constructor Details

    • AStarSolver

      public AStarSolver(Model<T> model)
  • Method Details

    • minimize

      public Solution minimize(Predicate<SearchStatistics> limit, BiConsumer<int[],SearchStatistics> onSolution)
      Description copied from interface: Solver
      Minimizes the objective function according to the solver strategy.
      Specified by:
      minimize in interface Solver
      Parameters:
      limit - a Predicate that can limit or stop the search based on current SearchStatistics
      onSolution - a BiConsumer invoked on each new solution found; receives the solution array and current statistics
      Returns:
      the statistics of the search after completion
    • bestValue

      public Optional<Double> bestValue()
      Specified by:
      bestValue in interface Solver
      Returns:
      the value of the best solution in this decision diagram if there is one
    • bestSolution

      public Optional<Set<Decision>> bestSolution()
      Description copied from interface: Solver
      Returns the set of decisions that lead to the best solution found by this solver, if any.
      Specified by:
      bestSolution in interface Solver
      Returns:
      an Optional containing the set of Decision objects representing the best solution, or empty if no solution exists