Beispiel #1
0
 def evaluate2(self, state, player, action =None, quad_table_ext=None):
     '''
     @type state: loa_game.LinesOfActionState
     '''
     
     cmt = initialize(state.board)
     cmt.coord_repr
     EndTimer.check(name="cm_f")
     
     my_coord_list = cmt.coord_repr[player]
     cm = cmt.cm_dict[player]
     
     EndTimer.check(name="cm_g")
     
     GTimeStatistics.start_measure("sum_of_min_distances_ext2")
     rsmd = self.sum_of_min_distances_ext2(cm,my_coord_list)
     GTimeStatistics.stop_measure("sum_of_min_distances_ext2")
     
     smart_sum, smart_sum_count, dsum, dmin_sum, dmin, dmin_count = rsmd
     
     r1 = self.min_sum_res(smart_sum_count, smart_sum)
     r2 = self.min_sum_fix(dmin, dmin_count, len(my_coord_list))
     
     
     return r1, r2
Beispiel #2
0
 def utility(self, state, info_set):
     GTimeStatistics.start_measure("agent.utility")
     hv = self.evaluator.evaluate(state, self.player, info_set)
     GTimeStatistics.stop_measure("agent.utility")
     return hv
Beispiel #3
0
 def utility(self,state,info_set):
     GTimeStatistics.start_measure("heur")
     r = self.evaluator.evaluate(state, self.player,info_set)
     GTimeStatistics.stop_measure("heur")
     return r