From 6fd839351cad4b4f6ec97891fa333c637909aaf6 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Tue, 27 Jul 2021 11:50:03 -0500 Subject: [PATCH] GurobiSolver: Fix error messages --- miplearn/solvers/gurobi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/miplearn/solvers/gurobi.py b/miplearn/solvers/gurobi.py index a187869..20982f9 100644 --- a/miplearn/solvers/gurobi.py +++ b/miplearn/solvers/gurobi.py @@ -579,16 +579,16 @@ class GurobiSolver(InternalSolver): if var_types[i] == "I": assert var_ubs[i] == 1.0, ( "Only binary and continuous variables are currently supported. " - "Integer variable {var.varName} has upper bound {var.ub}." + f"Integer variable {var_names[i]} has upper bound {var_ubs[i]}." ) assert var_lbs[i] == 0.0, ( "Only binary and continuous variables are currently supported. " - "Integer variable {var.varName} has lower bound {var.ub}." + f"Integer variable {var_names[i]} has lower bound {var_ubs[i]}." ) var_types[i] = "B" assert var_types[i] in ["B", "C"], ( "Only binary and continuous variables are currently supported. " - "Variable {var.varName} has type {vtype}." + f"Variable {var_names[i]} has type {var_types[i]}." ) varname_to_var[var_names[i]] = gp_var for (i, gp_constr) in enumerate(gp_constrs):