Skip to content

Commit

Permalink
MO Emulator: fix .objabstol, .objreltol #239
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Jun 15, 2024
1 parent 7c8be43 commit b450cad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/mp/flat/converter_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ class FlatModel

mapi.InitProblemModificationPhase(GetModelInfo());
PushVariablesTo(mapi);
PushCustomConstraintsTo(mapi);
if (!if_skip_pushing_objs())
PushObjectivesTo(mapi);
PushCustomConstraintsTo(mapi);
mapi.FinishProblemModificationPhase();
}

Expand Down
19 changes: 10 additions & 9 deletions include/mp/flat/converter_multiobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ class MOManager {
std::function<sol::Status(void)> get_stt, std::function<Solution(void)> get_sol) {
if (++i_current_obj_ >= obj_new_.size()) {
status_ = MOManagerStatus::FINISHED;
MPD( GetEnv() ).Print(
"\n\n"
"==============================================================================\n"
"MULTI-OBJECTIVE MODE: done.\n\n");
return false; // all done
if (MPD( GetEnv() ).verbose_mode())
MPD( GetEnv() ).Print(
"\n\n"
"==============================================================================\n"
"MULTI-OBJECTIVE MODE: done.\n\n");
return false; // all done
}
if (MPD( GetEnv() ).verbose_mode())
MPD( GetEnv() ).Print(
Expand Down Expand Up @@ -216,17 +217,17 @@ class MOManager {
if (obj_last.GetQPTerms().size()) {
if (obj::MAX == obj_last.obj_sense())
MPD( AddConstraint(
QuadConGE{ { obj_last.GetLinTerms(), obj_last.GetQPTerms() }, objval_last_ } ) );
QuadConGE{ { obj_last.GetLinTerms(), obj_last.GetQPTerms() }, lim } ) );
else
MPD( AddConstraint(
QuadConLE{ { obj_last.GetLinTerms(), obj_last.GetQPTerms() }, objval_last_ } ) );
QuadConLE{ { obj_last.GetLinTerms(), obj_last.GetQPTerms() }, lim } ) );
} else {
if (obj::MAX == obj_last.obj_sense())
MPD( AddConstraint(
LinConGE{ { obj_last.GetLinTerms() }, objval_last_ } ) );
LinConGE{ { obj_last.GetLinTerms() }, lim } ) );
else
MPD( AddConstraint(
LinConLE{ { obj_last.GetLinTerms() }, objval_last_ } ) );
LinConLE{ { obj_last.GetLinTerms() }, lim } ) );
}
}

Expand Down

0 comments on commit b450cad

Please sign in to comment.