merovingien / AIWar

Create your Artificial Intelligence to win the war
GNU General Public License v3.0
4 stars 2 forks source link

A match is not deterministic #20

Closed merovingien closed 11 years ago

merovingien commented 11 years ago

With the same data at start time, two consecutive matches are not identical, even without use of randomness!

Data in entry :

Result: The about 1000 first rounds are identical, and at a moment, there is one difference.

merovingien commented 11 years ago

This issue was caused by the use of a set of pointers to report neighborhood. The memory allocation is not deterministic, so items in the set were not always present in the same order.

Now neighborhood is returned as a list of item pointers, which preserve the order of insertion. The python handler has also been updated to return a list of items. Player's scripts should not be impacted.

The bug is fixed by commit e29b36b