@@ -136,7 +136,11 @@ int GurobiSolver::solve(Model& model)
136
136
{
137
137
auto _model = model.repn .get ();
138
138
139
- env = new GRBEnv ();
139
+ env = new GRBEnv (true );
140
+ auto it = integer_options ().find (" OutputFlag" );
141
+ if (it != integer_options ().end ())
142
+ env->set (GRB_IntParam_OutputFlag, it->second );
143
+ env->start ();
140
144
gmodel = new GRBModel (*env);
141
145
142
146
assert (_model->objectives .size () == 1 );
@@ -225,7 +229,11 @@ int GurobiSolver::solve(CompactModel& compact_model)
225
229
{
226
230
std::cout << " STARTING GUROBI" << std::endl << std::flush;
227
231
228
- env = new GRBEnv ();
232
+ env = new GRBEnv (true );
233
+ auto it = integer_options ().find (" OutputFlag" );
234
+ if (it != integer_options ().end ())
235
+ env->set (GRB_IntParam_OutputFlag, it->second );
236
+ env->start ();
229
237
gmodel = new GRBModel (*env);
230
238
231
239
std::cout << " BUILDING GUROBI MODEL" << std::endl << std::flush;
@@ -348,7 +356,11 @@ int GurobiSolver::resolve()
348
356
auto _model = model.repn .get ();
349
357
350
358
if (initial_solve ()) {
351
- env = new GRBEnv ();
359
+ env = new GRBEnv (true );
360
+ auto it = integer_options ().find (" OutputFlag" );
361
+ if (it != integer_options ().end ())
362
+ env->set (GRB_IntParam_OutputFlag, it->second );
363
+ env->start ();
352
364
gmodel = new GRBModel (*env);
353
365
354
366
assert (_model->objectives .size () == 1 );
0 commit comments