Skip to content

Commit

Permalink
Adjust where we count removed pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
WPettersson committed Jul 22, 2020
1 parent ce0ec39 commit ef26431
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions HRT/4_YESBIN_2STA_NOMERGED_BOTHTIES/Allocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ int Allocation::reductionMineDoctors(int mode) {
int remHere = 0;
#endif /* DEBUG */
for (int k = worst_rank + 1; k < doctors[i].nbPref; k++) {
nbTotRem += doctors[i].preferences[k].size();
doctors[i].nbTotPref -= doctors[i].preferences[k].size();
for (size_t id = 0; id < doctors[i].preferences[k].size(); ++id) {
nbTotRem += 1;
#ifdef DEBUG
remHere += 1;
#endif /* DEBUG */
Expand Down Expand Up @@ -452,11 +453,11 @@ int Allocation::reductionExactDoctor(bool supp) {
int remHere = 0;
#endif /* DEBUG */
for (int k = rank + 1; k < doctors[i].nbPref; k++) {
for (size_t id = 0; id < doctors[i].preferences[k].size(); ++id) {
nbTotRem += 1;
nbTotRem += doctors[i].preferences[k].size();
#ifdef DEBUG
remHere += 1;
remHere += doctors[i].preferences[k].size();
#endif /* DEBUG */
for (size_t id = 0; id < doctors[i].preferences[k].size(); ++id) {
int idxHos = doctors[i].preferences[k][id] - 1;
// remove from idxHos any reference to i.
for(size_t rank = 0 ; rank < hospitals[idxHos].preferences.size(); ++rank) {
Expand Down

0 comments on commit ef26431

Please sign in to comment.