odys.solvers.config_translators¶
Internal implementation detail. Most users do not need this page directly.
See Solvers in the User Guide for the public API.
Per-solver option translation for linopy solver backends.
Translates common option names (time_limit, presolve, etc.) into the format each solver expects.
CPLEXOptionTranslator
¶
Option translator for CPLEX solver.
Source code in src/odys/solvers/config_translators.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
translate(config)
¶
Translate common options to CPLEX solver format.
Source code in src/odys/solvers/config_translators.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
GurobiOptionTranslator
¶
Option translator for Gurobi solver.
Source code in src/odys/solvers/config_translators.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
translate(config)
¶
Translate common options to Gurobi solver format.
Source code in src/odys/solvers/config_translators.py
41 42 43 44 45 46 47 48 49 50 51 52 53 | |
HiGHSOptionTranslator
¶
Option translator for HiGHS solver.
Source code in src/odys/solvers/config_translators.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
translate(config)
¶
Translate common options to HiGHS solver format.
Source code in src/odys/solvers/config_translators.py
23 24 25 26 27 28 29 30 31 32 33 34 35 | |
SCIPOptionTranslator
¶
Option translator for SCIP solver.
Source code in src/odys/solvers/config_translators.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
translate(config)
¶
Translate common options to SCIP solver format.
Source code in src/odys/solvers/config_translators.py
78 79 80 81 82 83 84 85 86 87 88 89 90 | |
SolverOptionTranslator
¶
Bases: Protocol
Protocol for translating common options to solver-specific format.
Source code in src/odys/solvers/config_translators.py
12 13 14 15 16 17 | |
translate(config)
¶
Translate common options to solver-specific format.
Source code in src/odys/solvers/config_translators.py
15 16 17 | |
translate_solver_config(solver_config)
¶
Translate common option names to solver-specific option names.
For known solvers (HiGHS, Gurobi, CPLEX, SCIP), applies the
appropriate translation. Raw solver_options are applied last and
override translated options with the same name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solver_config
|
SolverConfig
|
Solver config |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Solver-specific options dict ready for linopy's |
Source code in src/odys/solvers/config_translators.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |