Created
October 27, 2017 17:32
-
-
Save backnotprop/8c153462ae0a81c312e12b31fcac8784 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Elimination Stage 2 | |
* - removes all preferences in a list who can not be possibly matched | |
*/ | |
function _eliminateStage() { | |
_.forIn(_DB, (person,id) => { | |
let keepLast = _.findIndex(person.choices, function(p) { return p.id == person.acceptedReceivedID; }); | |
for(let i = keepLast + 1; i < person.choices.length; i++) { | |
// each the rejected and rejecter can remove each other from choices list | |
eliminateChoices(person, _DB[person.choices[i].id]); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment