Class Solution

java.lang.Object
org.ddolib.layered.solver.Solution

public class Solution extends Object
Wrapper defining a solution from a set of decisions.
  • Constructor Details

    • Solution

      public Solution(Optional<Set<Decision>> decisions, SearchStatistics statistics)
      Constructs a solution given a set of decision and SearchStatistics on this set.
      Parameters:
      decisions - the set of decision leading to this solution
      statistics - the statistics related to this solution
  • Method Details

    • value

      public double value()
      Returns the evaluation of the objective value of this solution.
      Returns:
      the evaluation of the objective value of this solution
    • solution

      public int[] solution()
      Returns an array t such that t[i] is the assigned value to the decision variable x_i.
      Returns:
      an array t such that t[i] is the assigned value to the decision variable x_i.
    • isEmpty

      public boolean isEmpty()
      Returns whether this solution is empty, i.e. no solution was found.
      Returns:
      true if this solution does not assign any variable
    • decisions

      public Set<Decision> decisions()
      Returns the decisions assigning each variable to its value in this solution.
      Returns:
      the set of decisions (i, t[i]) where t is solution()
    • statistics

      public SearchStatistics statistics()
      Returns the statistics associated to this solution.
      Returns:
      the statistics associated to this solution
    • searchTime

      public String searchTime()
      Returns a readable string for the search time needed to find this solution.
      Returns:
      a readable string for the search time needed to find this solution
    • toString

      public String toString()
      Overrides:
      toString in class Object