Created
March 7, 2021 18:45
-
-
Save Albertbol/884669f68adaa89bf60a882120bb1507 to your computer and use it in GitHub Desktop.
This file contains 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
normalization() { | |
let powSum = 0 | |
population.forEach((p, i) => { | |
powSum += population[i].powRate | |
}) | |
population.forEach((p, i) => { | |
population[i].powRate = p.powRate / powSum | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment