14package com.google.ortools.modelbuilder;
16import java.time.Duration;
17import java.util.function.Consumer;
20public final class ModelSolver {
21 static class ModelSolverException
extends RuntimeException {
22 public ModelSolverException(String methodName, String msg) {
24 super(methodName +
": " + msg);
31 this.logCallback =
null;
36 if (logCallback ==
null) {
86 throw new ModelSolverException(
87 "ModelSolver.getObjectiveValue()",
"solve() was not called or no solution was found");
95 throw new ModelSolverException(
96 "ModelSolver.getBestObjectiveBound()",
"solve() was not called or no solution was found");
104 throw new ModelSolverException(
105 "ModelSolver.getValue())",
"solve() was not called or no solution was found");
115 throw new ModelSolverException(
116 "ModelSolver.getReducedCost())",
"solve() was not called or no solution was found");
127 throw new ModelSolverException(
128 "ModelSolver.getDualValue())",
"solve() was not called or no solution was found");
138 throw new ModelSolverException(
139 "ModelSolver.getActivity())",
"solve() was not called or no solution was found");
146 this.logCallback = cb;
160 private Consumer<String> logCallback;