Gurobi Edit

This commit is contained in:
Nicolai 2026-03-26 13:36:41 +01:00
parent ab514d5ee8
commit a8ad3adde5
2 changed files with 4 additions and 4 deletions

View File

@ -866,8 +866,8 @@ async def run(
max_runtime_minutes: float = Form(10.0), max_runtime_minutes: float = Form(10.0),
) -> dict[str, str]: ) -> dict[str, str]:
solver = solver.lower().strip() solver = solver.lower().strip()
if solver != "highs": if solver not in {"highs", "gurobi"}:
raise HTTPException(status_code=400, detail="Only HiGHS is enabled at the moment") raise HTTPException(status_code=400, detail="Unsupported solver")
availability = _get_solver_availability() availability = _get_solver_availability()
if not availability.get(solver, False): if not availability.get(solver, False):
raise HTTPException(status_code=400, detail=f"Solver not available: {solver}") raise HTTPException(status_code=400, detail=f"Solver not available: {solver}")

View File

@ -376,7 +376,7 @@ export default function App() {
const reported = data?.solvers || {}; const reported = data?.solvers || {};
const solvers = { const solvers = {
highs: reported.highs !== false, highs: reported.highs !== false,
gurobi: false, gurobi: reported.gurobi === true,
}; };
setAvailableSolvers(solvers); setAvailableSolvers(solvers);
if (solver === "gurobi" && !solvers.gurobi) { if (solver === "gurobi" && !solvers.gurobi) {
@ -785,7 +785,7 @@ export default function App() {
onChange={(event) => setSolver(event.target.value)} onChange={(event) => setSolver(event.target.value)}
> >
<option value="highs">HiGHS</option> <option value="highs">HiGHS</option>
<option value="gurobi" disabled> <option value="gurobi" disabled={!availableSolvers.gurobi}>
Gurobi Gurobi
</option> </option>
</select> </select>