def setupGameAndBots(context): myTeam = Model.Team('my_team', name='My Team', race='Humans', coach='AI Coach') theirTeam = Model.Team('their_team', name='Their Team', race='Humans', coach='AI Coach') config = load.get_config("ff-11.json") context.myBot = sagelingbot.SagelingBot('HomeAgentBot') theirBot = sagelingbot.SagelingBot('AwayAgentBot') context.game = game.Game('test_game', home_team=myTeam, away_team=theirTeam, home_agent=context.myBot, away_agent=theirBot, config=config)
from ffai.ai.competition import Competition import examples.scripted_bot_example import examples.grodbot from copy import deepcopy from ffai.core.load import get_team, get_rule_set, get_config config = get_config('ff-11.json') # Random vs. random competition = Competition('MyCompetition', competitor_a_team_id='human-1', competitor_b_team_id='human-2', competitor_a_name='random', competitor_b_name='random', config=config) results = competition.run(num_games=2) results.print() ''' # Random vs. idle config.time_limits.game_time_limit = 10 # 10 second time limit per game config.time_limits.turn_time_limit = 1 # 1 second time limit per turn competition = Competition('MyCompetition', competitor_a_team_id='human-1', competitor_b_team_id='human-2', competitor_a_name='random', competitor_b_name='idle', config=config) results = competition.run(num_games=2) results.print() # Random vs. violator config.time_limits.game_time_limit = 60 # 60 second time limit per game config.time_limits.turn_time_limit = 1 # 1 second time limit per turn config.time_limits.opp__time_limit = 1 # 1 second time limit per opponent choice config.time_limits.violation_threshold = 1 # 1 violation limit competition = Competition('MyCompetition', competitor_a_team_id='human-1', competitor_b_team_id='human-2', competitor_a_name='random', competitor_b_name='violator', config=config)
#!/usr/bin/env python3 from ffai.ai.competition import Competition import examples.scripted_bot_example import examples.grodbot from copy import deepcopy from ffai.core.load import get_team, get_rule_set, get_config import noone.a2c_agent # Load competition configuration for the bot bowl config = get_config('ff-11-bot-bowl-i.json') # scripted vs. random competition = Competition('MyCompetition', competitor_a_team_id='human-1', competitor_b_team_id='human-2', competitor_a_name='scripted', competitor_b_name='random', config=config) results = competition.run(num_games=2) results.print() # Random vs. Random competition = Competition('MyCompetition', competitor_a_team_id='human-1', competitor_b_team_id='human-2', competitor_a_name='random', competitor_b_name='grodbot', config=config) results = competition.run(num_games=2) results.print()