mardi 20 septembre 2016

C++ random agent moves are identical

I use this function (http://ift.tt/2cADb1a) to generate random permutations of the digits 0,1,2,3 which are translated to moves by agents in a 2-dimensional grid for the game Tron. However, I have two issues:

  • If two agents make consecutive moves they make the same move due to the fact that the random number is dependent on time.
  • If the agents play multiple rounds after each other, the moves of both agents are identical to the moves in the previous game. So eventually the grid is always the same and 1 agent ends up winning 95%-100% of the games in most cases.

All help will be highly appreciated, thanks!




Aucun commentaire:

Enregistrer un commentaire