Created
October 27, 2017 15:17
-
-
Save fedden/b36e7d73e6d3f560755a423a714eeea3 to your computer and use it in GitHub Desktop.
test_phase
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 (auto& agent : agents) | |
{ | |
if (agent->set_happy(partial_grid)) | |
{ | |
happy_agents.push_back(agent); | |
const size_t hill_index = get_hill_index((*agent), partial_size, grid_size); | |
if (++most_frequent_hill_indices[hill_index] > max_indices) | |
{ | |
max_indices = most_frequent_hill_indices[hill_index]; | |
best_index = hill_index; | |
} | |
} | |
else | |
unhappy_agents.push_back(agent); | |
} | |
best_hill_coordinates = get_hill_position(best_index, partial_size, grid_size, draw_scalar); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment