-
-
Save jamiecook/d0a319a01f873917601d 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
for (int col = 0; col < numCentroids; ++col) | |
{ | |
float skim_value = skim_row[col]; | |
if (attractions.at(col) == 0 || skim_value == 99999) | |
{ | |
utilities.at(col) = 99999; | |
continue; | |
} | |
float cost_based_utility = alpha * log_skim_row[col] + beta * adj_skim_row[col] - min_utility; | |
utilities.at(col) = (cost_based_utility < 0) ? 99999 : log_attractions.at(col) + cost_based_utility; | |
if (utilities.at(col) != 99999 && utilities.at(col) > maxV) | |
{ | |
maxV = utilities.at(col); | |
destinationWithMaxV = col; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment