examples: backport from main

This commit is contained in:
Corentin Le Molgat
2025-07-23 17:38:49 +02:00
committed by Mizux Seiha
parent a7f49a2585
commit f0d0fe71ba
32 changed files with 335 additions and 64 deletions

View File

@@ -33,7 +33,7 @@ from typing import Dict, Sequence
from absl import app
from absl import flags
from google.protobuf import text_format
from ortools.sat.python import cp_model
@@ -272,7 +272,7 @@ def solve_problem_with_boolean_model(
# solve model.
solver = cp_model.CpSolver()
if _PARAMS.value:
text_format.Parse(_PARAMS.value, solver.parameters)
solver.parameters.parse_text_format(_PARAMS.value)
solver.parameters.log_search_progress = True
solver.solve(model)
@@ -339,7 +339,7 @@ def solve_problem_with_scheduling_model(
# solve model.
solver = cp_model.CpSolver()
if _PARAMS.value:
text_format.Parse(_PARAMS.value, solver.parameters)
solver.parameters.parse_text_format(_PARAMS.value)
solver.parameters.log_search_progress = True
solver.solve(model)