Package org.ddolib.layered.solver
Class Solution
java.lang.Object
org.ddolib.layered.solver.Solution
Wrapper defining a solution from a set of decisions.
-
Constructor Summary
ConstructorsConstructorDescriptionSolution(Optional<Set<Decision>> decisions, SearchStatistics statistics) Constructs a solution given a set of decision andSearchStatisticson this set. -
Method Summary
Modifier and TypeMethodDescriptionReturns the decisions assigning each variable to its value in this solution.booleanisEmpty()Returns whether this solution is empty, i.e.Returns a readable string for the search time needed to find this solution.int[]solution()Returns an arraytsuch thatt[i]is the assigned value to the decision variablex_i.Returns the statistics associated to this solution.toString()doublevalue()Returns the evaluation of the objective value of this solution.
-
Constructor Details
-
Solution
Constructs a solution given a set of decision andSearchStatisticson this set.- Parameters:
decisions- the set of decision leading to this solutionstatistics- 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 arraytsuch thatt[i]is the assigned value to the decision variablex_i.- Returns:
- an array
tsuch thatt[i]is the assigned value to the decision variablex_i.
-
isEmpty
public boolean isEmpty()Returns whether this solution is empty, i.e. no solution was found.- Returns:
trueif this solution does not assign any variable
-
decisions
Returns the decisions assigning each variable to its value in this solution.- Returns:
- the set of decisions
(i, t[i])wheretissolution()
-
statistics
Returns the statistics associated to this solution.- Returns:
- the statistics associated to this solution
-
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
-