Ejemplo n.º 1
0
def main():
    tester = GameTester("Caching Nodes threshold", same_agents=False)

    game_params = {"size": 8, "turns_left": 60, "turn_time_limit": 12.0, "setup_time_limit": 5.0}

    for threshold in threshold_LIST:
        a1_params = {
            "caching": True,
            "init_max_depth": 2,
            "depth_delta": 100,
            "use_iterative": ITERATIVE,
            "evaluator": WeightedEvaluatorH(0.3, 0.0, 0.05, 0.25),
            "max_states_in_cache": threshold,
        }
        a1 = AnytimeSmartAlphaBetaPrintAgentParams

        a2_params = {
            "caching": False,
            "init_max_depth": 2,
            "depth_delta": 100,
            "use_iterative": ITERATIVE,
            "evaluator": WeightedEvaluatorH(0.3, 0.0, 0.05, 0.25),
        }
        a2 = AnytimeSmartAlphaBetaPrintAgentParams
        tester.run_game_pair(a1, a1_params, a2, a2_params, game_params)
        # check hit rate
        # number of node / times
    print "==========================="
    print tester.result()
    tester.save_result()
Ejemplo n.º 2
0
def main():
    tester = GameTester("Caching Effectiveness",same_agents=False)
    
    a1_params = {
      'caching':True,
      'init_max_depth': 2,
      'depth_delta':1,
      'use_iterative' : ITERATIVE,
      'evaluator' : WeightedEvaluatorH(0.3, 0.0, 0.05, 0.25)
    }
    a1 = AnytimeSmartAlphaBetaPrintAgentParams

    a2_params = {
      'caching':False,
      'init_max_depth': 2,
      'depth_delta':1,
      'use_iterative' : ITERATIVE,
      'evaluator' : WeightedEvaluatorH(0.3, 0.0, 0.05, 0.25)
    }
    a2 = AnytimeSmartAlphaBetaPrintAgentParams
    
    
    for turns in TURNS_LIST:
        game_params = {
            'size' : 8,
            'turns_left' : turns,
        
            'turn_time_limit' :  10.0,
            'setup_time_limit' : 5.0
        }
        tester.run_game_pair(a1,a1_params,a2,a2_params,game_params)

    print tester.result()
    tester.save_result()
Ejemplo n.º 3
0
def main():
    tester = GameTester("Heuristic Params3")
    
    game_params_arr = load_games()
    
    a1_params =  {
      'caching':True,
      'init_max_depth': 2,
      'depth_delta':1,
      'use_iterative' : ITERATIVE,
      'evaluator' : WeightedEvaluatorH(0.4, 0.05, 0.1, 0.0)
                
    }
    a  = AnytimeSmartAlphaBetaPrintAgentParams
    ar = RandomAgent
    
    for game_params in game_params_arr:
        tester.run_game_pair(a,a1_params,ar,{},game_params)
    print tester.result()
    tester.save_result()
Ejemplo n.º 4
0
def main():
    tester = GameTester("Caching Nodes Explored", same_agents=False)
    
    game_params = {
        'size' : 8,
        'turns_left' : 60,
    
        'turn_time_limit' : 12.0,
        'setup_time_limit' : 5.0
    }
    
    for init_depth in init_depth_LIST:
        a1_params = {
          'caching':True,
          'init_max_depth': init_depth,
          'depth_delta':100,
          'use_iterative' : ITERATIVE,
          'evaluator' : WeightedEvaluatorH(0.3, 0.0, 0.05, 0.25)
                    
        }
        a1 = AnytimeSmartAlphaBetaPrintAgentParams
    
        a2_params = {
          'caching':False,
          'init_max_depth': init_depth,
          'depth_delta':100,
          'use_iterative' : ITERATIVE,
          'evaluator' : WeightedEvaluatorH(0.3, 0.0, 0.05, 0.25)
                    
        }
        a2 = AnytimeSmartAlphaBetaPrintAgentParams
        tester.run_game_pair(a1,a1_params,a2,a2_params,game_params)
        # check hit rate
        # number of node / times
    print "==========================="
    print tester.result()
    tester.save_result()