def registerInitialState(self, gameState):
"""
This method handles the initial setup of the
agent to populate useful fields (such as what team
we're on).
A distanceCalculator instance caches the maze distances
between each pair of positions, so your agents can use:
self.distancer.getDistance(p1, p2)
"""
self.red = gameState.isOnRedTeam(self.index)
self.distancer = distanceCalculator.Distancer(gameState.data.layout)
# comment this out to forgo maze distance computation and use manhattan distances
self.distancer.getMazeDistances()
import __main__
if '_display' in dir(__main__):
self.display = __main__._display
评论列表
文章目录