You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible for both the territory and the territory integral of two players to be the same. (Especially when someone is testing versions of their bots locally -- they may behave identically.)
Such ties should be broken randomly (instead of based on player index).
Which I think could be replaced with something like this, except I'm not a C++ person. Presumably we also need to import some PRNG function and seed it at some point...
// Sort newRankings by last territory count. If it's the same, use the territory integral instead to break that tie.
// But if that's the same, flip a coin.
std::stable_sort(newRankings.begin(), newRankings.end(), [&](const unsigned int & u1, const unsigned int & u2) -> bool {
if (last_territory_count[u1] != last_territory_count[u2]) {
return last_territory_count[u1] < last_territory_count[u2];
}
if (full_territory_count[u1] != full_territory_count[u2]) {
return full_territory_count[u1] < full_territory_count[u2];
}
return RESULT_OF_SOME_COIN_FLIP; // Don't know the C++ way to do this.
});
The text was updated successfully, but these errors were encountered:
It would be nice if ties were actually treated as ties, but I think it's too late to make such a drastic change. Randomization is a compromise that would help, but from what @Sydriax has said before I'm not sure even that would be accepted at this point since it would change results of old replays using the same seed and competitors?
I think these "complete ties" are already broken randomly, because as you say, they are broken by player index -- and the indices were assigned randomly. At least I think they are (should be), I haven't checked the code. If you are using the @smiley1983 halite-match-manager locally, the player indices are certainly assigned randomly (that code I know), so there is no bias in the tiebreak.
It's possible for both the territory and the territory integral of two players to be the same. (Especially when someone is testing versions of their bots locally -- they may behave identically.)
Such ties should be broken randomly (instead of based on player index).
I believe the relevant piece of code is at:
https://github.com/HaliteChallenge/Halite/blob/master/environment/core/Halite.cpp#L347
Which I think could be replaced with something like this, except I'm not a C++ person. Presumably we also need to import some PRNG function and seed it at some point...
The text was updated successfully, but these errors were encountered: