[docs]defsolver_factory(solver_name:str):"""Create a Solver object tied to the specified external MILP solver. Note that the only solver that is a dependency of OptiWindNet is 'ortools'. Check OptiWindNet's documentation on how to install optional solvers. Args: solver_name: one of 'ortools', 'cplex', 'gurobi', 'cbc', 'scip', 'highs'. Returns: Solver instance that can produce solutions for the cable routing problem. """matchsolver_name:case'ortools':from.ortoolsimportSolverORToolsreturnSolverORTools()case'cplex':from.cpleximportSolverCplexreturnSolverCplex()case'gurobi':from.gurobiimportSolverGurobireturnSolverGurobi()case'cbc'|'scip':from.pyomoimportSolverPyomoreturnSolverPyomo(solver_name)case'highs':# Pyomo's appsi solversfrom.pyomoimportSolverPyomoreturnSolverPyomo(solver_name,prefix='appsi_')case_:_lggr.error('Unsupported solver: %s',solver_name)returnNone