Skip to content

Instantly share code, notes, and snippets.

@Debilski
Created September 2, 2017 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Debilski/4f6904729d6330fb4ee221f37cd49e34 to your computer and use it in GitHub Desktop.
Save Debilski/4f6904729d6330fb4ee221f37cd49e34 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from pelita.tournament.tournament import run_match"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Create a fake config object\n",
"class Config:\n",
" rounds = 5 # Only change this line\n",
" filter = None\n",
" viewer = 'null'\n",
" tournament_log_folder = None\n",
" team_spec = lambda s, x: x"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"team_1 = \"my_team\"\n",
"team_2 = \"StoppingPlayer\""
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"final_state, stdout, stderr = run_match(Config(), [team_1, team_2])"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'bot_destroyed': [],\n",
" 'bot_error': {},\n",
" 'bot_id': 0,\n",
" 'bot_moved': [],\n",
" 'bot_talk': ['', '', '', ''],\n",
" 'bot_timeout': None,\n",
" 'finished': True,\n",
" 'food_count': [0, 0],\n",
" 'food_eaten': [],\n",
" 'food_to_eat': [30, 30],\n",
" 'game_draw': None,\n",
" 'game_time': 5,\n",
" 'layout_name': 'layout_normal_without_dead_ends_074',\n",
" 'max_timeouts': 5,\n",
" 'noise_radius': 5,\n",
" 'noise_sight_distance': 5,\n",
" 'round_index': 0,\n",
" 'running_time': 3.006007090967614,\n",
" 'team_name': [None, 'The StoppingPlayers'],\n",
" 'team_time': [0, 0],\n",
" 'team_wins': 1,\n",
" 'teams_disqualified': ['disconnected', None],\n",
" 'timeout_length': 3,\n",
" 'timeout_teams': [0, 0],\n",
" 'times_killed': [0, 0]}"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"final_state"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment