(battle_info, agents)
Agents is a list of dicts specifying docker image, aid, and agent_id.
Agents is a list of dicts specifying docker image, aid, and agent_id.
Agents is a list of dicts specifying docker image aid and agent_id .
def run_battle(battle_info, agents):
    """Agents is a list of dicts specifying docker image, aid, and agent_id."""
    suffix = battle_info
    record_pngs_dir = os.path.join(png_directory, suffix)
    record_json_dir = os.path.join(json_directory, suffix)
    battle = Battle(agents, record_pngs_dir, record_json_dir)
    info = battle.run()
    logging.warn("Info from the run_battle on %s:" % battle_info)
    logging.warn(info)

    # Tell the server about the result.
    request_json = {
        'result': info['result'].value,
        'winners': info.get('winners', []),
        'battle_info': battle_info,
        'access': os.getenv("PLAYGROUND_GAME_MANAGER_ACCESS")
    }
    request_url = os.getenv("PLAYGROUND_SERVER_URL") + "/admin/report_result"
    requests.post(request_url, json=request_json)
def run_battle ( battle_info , agents ) : suffix = battle_info record_pngs_dir = os . path . join ( png_directory , suffix ) record_json_dir = os . path . join ( json_directory , suffix ) battle = Battle ( agents , record_pngs_dir , record_json_dir ) info = battle . run ( ) logging . warn ( "Info from the run_battle on %s:" % battle_info ) logging . warn ( info ) # Tell the server about the result. request_json = { 'result' : info [ 'result' ] . value , 'winners' : info . get ( 'winners' , [ ] ) , 'battle_info' : battle_info , 'access' : os . getenv ( "PLAYGROUND_GAME_MANAGER_ACCESS" ) } request_url = os . getenv ( "PLAYGROUND_SERVER_URL" ) + "/admin/report_result" requests . post ( request_url , json = request_json )