Gurobi Edit
This commit is contained in:
parent
ab514d5ee8
commit
a8ad3adde5
@ -866,8 +866,8 @@ async def run(
|
||||
max_runtime_minutes: float = Form(10.0),
|
||||
) -> dict[str, str]:
|
||||
solver = solver.lower().strip()
|
||||
if solver != "highs":
|
||||
raise HTTPException(status_code=400, detail="Only HiGHS is enabled at the moment")
|
||||
if solver not in {"highs", "gurobi"}:
|
||||
raise HTTPException(status_code=400, detail="Unsupported solver")
|
||||
availability = _get_solver_availability()
|
||||
if not availability.get(solver, False):
|
||||
raise HTTPException(status_code=400, detail=f"Solver not available: {solver}")
|
||||
|
||||
@ -376,7 +376,7 @@ export default function App() {
|
||||
const reported = data?.solvers || {};
|
||||
const solvers = {
|
||||
highs: reported.highs !== false,
|
||||
gurobi: false,
|
||||
gurobi: reported.gurobi === true,
|
||||
};
|
||||
setAvailableSolvers(solvers);
|
||||
if (solver === "gurobi" && !solvers.gurobi) {
|
||||
@ -785,7 +785,7 @@ export default function App() {
|
||||
onChange={(event) => setSolver(event.target.value)}
|
||||
>
|
||||
<option value="highs">HiGHS</option>
|
||||
<option value="gurobi" disabled>
|
||||
<option value="gurobi" disabled={!availableSolvers.gurobi}>
|
||||
Gurobi
|
||||
</option>
|
||||
</select>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user