I’m using OptaPy’s planner to solve an optimization problem. All is well but since I must solve a high number of problems sequentially I would like for the OptaPy’s solver to stop printing status messages on the standard output.
I can’t seem to find any help in their documentation but I’m sure there must be a way to do this.
This is the solver’s initialization:
problem = generate_problem(<arguments>)
solver_config = optapy.config.solver.SolverConfig()
solver_config
.withSolutionClass(SolutionObj)
.withEntityClasses(EntityCLass)
.withConstraintProviderClass(study_plan_constraints)
.withTerminationSpentLimit(Duration.ofSeconds(30))
solution = solver_factory_create(solver_config)
.buildSolver()
.solve(problem)
The status printed on the terminal (that I wish to get rid of) is this:
13:53:44.474 [main ] INFO Solving started: time spent (127), best score (-1160hard/0soft), environment mode (REPRODUCIBLE), move thread count (NONE), random (JDK with seed 0).
13:53:44.480 [main ] INFO Construction Heuristic phase (0) ended: time spent (133), best score (-1160hard/0soft), score calculation speed (1000/sec), step total (0).
13:53:54.347 [main ] INFO Local Search phase (1) ended: time spent (10000), best score (0hard/-6soft), score calculation speed (179/sec), step total (1540).
13:53:54.348 [main ] INFO Solving ended: time spent (10000), best score (0hard/-6soft), score calculation speed (177/sec), phase total (2), environment mode (REPRODUCIBLE), move thread count (NONE).
I’m confident there exists a function for setting the solver’s verbosity but I can’t find it.
Andrea Di Marco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.