robbers, cops = graph.plot_graph(json_coordinate_file, robber_target) pylab.draw() monte = MCTS.MonteCarloTreeSearch(MCTS.Board(cop1, robber1)) print "ROBBER:" robber_strategy = DiarrheaStrategy(robber_target, graph) # robber_strategy = MonteStrategy(16, monte) print "COP:" # cop_strategy = RandomCopStrategy() cop_strategy = MonteStrategy(monte, cop1, robber1) moves = 0 while game_on and moves < N: moves += 1 if not human_cop: rp_cop = graph.random_walk_on_graph(cop1.position) if not human_robber: rp_robber = graph.random_walk_on_graph(robber1.position) robber_strategy.cannottouch = graph.cops_places() if robber1.position == cop1.position or robber1.position in graph_representation[cop1.position]: game_on = False print "after cop move:" print "COP WON!" break elif robber1.position == robber_strategy.target or moves == N: game_on = False print "after cop move:" print "ROBBER WON!" break if not human_robber: robber1.change_position(robber_strategy.next_move(robber1))