def StartRandom(self,seed):
# This function initializes the fixed seed random method used by
# players. There is a concern that the use of this method, particularly
# the setting of a fixed seed, may bias other functions which wish to
# call random. For this reason, the RNG state is recorded at the start
# of the player call; the RNG state will then be set back to this state
# before the player concludes it's turn. This will prevent the fixed
# seed method from interacting with other random calls outside of the
# AI program.
self.RNG_State = random.getstate()
random.seed(seed)
评论列表
文章目录