You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
651 B
651 B
Customization
Selecting the internal MIP solver
By default, LearningSolver
uses Gurobi as its internal MIP solver. Alternative solvers can be specified through the internal_solver_factory
constructor argument. This argument should provide a function (with no arguments) that constructs, configures and returns the desired solver. To select CPLEX, for example:
from miplearn import LearningSolver
import pyomo.environ as pe
def cplex_factory():
cplex = pe.SolverFactory("cplex")
cplex.options["threads"] = 4
return cplex
solver = LearningSolver(internal_solver_factory=cplex_factory)