Created
December 9, 2015 16:28
-
-
Save barelyknown/9af5c766aaf7e8ba9895 to your computer and use it in GitHub Desktop.
optimize-roster-3.js
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
function setSolution(solution) { | |
// for each player | |
for (var row = 1; row <= PLAYERS.getNumRows(); row++) { | |
var playerId = PLAYERS.getCell( | |
row, | |
PLAYERS_PLAYER_COLUMN | |
).getValue(); | |
// set the selected column based on the optimization solution | |
PLAYERS.getCell( | |
row, | |
PLAYERS_SELECTED_COLUMN | |
).setValue( | |
solution.getVariableValue(playerId) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment