Skip to content

Commit

Permalink
MO Emulator: int .objpriority #239
Browse files Browse the repository at this point in the history
For compatibility with native handling in solvers
  • Loading branch information
glebbelov committed May 30, 2024
1 parent 1703d33 commit 9f0d43d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/mp/flat/converter_multiobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class MOManager {
// instead of current manual postsolving in ValuePresolver::PostsolveSolution().
const auto& obj_orig = MPD( get_objectives() ); // no linking
///////////////// Read / set default suffixes ///////////////////
std::vector<double> objpr = MPD( ReadDblSuffix( {"objpriority", suf::OBJ} ) );
std::vector<int> objpr = MPD( ReadIntSuffix( {"objpriority", suf::OBJ} ) ); // int only
objpr.resize(obj_orig.size(), 0.0); // blend objectives by default
std::vector<double> objwgt = MPD( GetMOWeightsLegacy() );
if (objwgt.empty()) {
Expand All @@ -122,7 +122,7 @@ class MOManager {
objtola.resize(obj_orig.size(), 0.0);
std::vector<double> objtolr = MPD( ReadDblSuffix( {"objreltol", suf::OBJ} ) );
objtolr.resize(obj_orig.size(), 0.0);
std::map<double, std::vector<int>, std::greater<double> > pr_map; // Decreasing order
std::map<int, std::vector<int>, std::greater<int> > pr_map; // Decreasing order
for (int i=0; i<objpr.size(); ++i)
pr_map[objpr[i]].push_back(i);
obj_new_ = {}; ////////////////// Aggregate new objectives ///////////////////
Expand Down

0 comments on commit 9f0d43d

Please sign in to comment.