sat: Update minimal jobshop sample
This commit is contained in:
@@ -205,7 +205,7 @@ public class MinimalJobshopSat {
|
||||
System.out.printf("Optimal Schedule Length: %f%n", solver.objectiveValue());
|
||||
System.out.printf(output);
|
||||
} else {
|
||||
System.out.println("No optimal solution found !");
|
||||
System.out.println("No solution found.");
|
||||
}
|
||||
// [END print_solution]
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ void MinimalJobshopSat() {
|
||||
// [END solve]
|
||||
|
||||
// [START print_solution]
|
||||
if (response.status() == CpSolverStatus::OPTIMAL) {
|
||||
if (response.status() == CpSolverStatus::OPTIMAL || response.status() == CpSolverStatus::FEASIBLE) {
|
||||
LOG(INFO) << "Solution:";
|
||||
// create one list of assigned tasks per machine.
|
||||
struct AssignedTaskType {
|
||||
@@ -188,7 +188,7 @@ void MinimalJobshopSat() {
|
||||
LOG(INFO) << "Optimal Schedule Length: " << response.objective_value();
|
||||
LOG(INFO) << "\n" << output;
|
||||
} else {
|
||||
LOG(INFO) << "No optimal solution found !";
|
||||
LOG(INFO) << "No solution found.";
|
||||
}
|
||||
// [END print_solution]
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ def main():
|
||||
# [END solve]
|
||||
|
||||
# [START print_solution]
|
||||
if status == cp_model.OPTIMAL:
|
||||
if status == cp_model.OPTIMAL or status == cp_model.FEASIBLE:
|
||||
print('Solution:')
|
||||
# Create one list of assigned tasks per machine.
|
||||
assigned_jobs = collections.defaultdict(list)
|
||||
@@ -138,7 +138,7 @@ def main():
|
||||
print(f'Optimal Schedule Length: {solver.ObjectiveValue()}')
|
||||
print(output)
|
||||
else:
|
||||
print('No optimal solution found !')
|
||||
print('No solution found.')
|
||||
# [END print_solution]
|
||||
|
||||
# Statistics.
|
||||
|
||||
Reference in New Issue
Block a user