from snake.game import Game, GameConf, GameMode

greedy = "GreedySolver"
hamilton = "HamiltonSolver"

normal = GameMode.NORMAL

conf = GameConf()
conf.solver_name = hamilton
conf.mode = normal
print("Solver: %s " % (conf.solver_name))
print("Mode: %s" % (conf.mode))
Game(conf).run()
コード例 #2
0
ファイル: run.py プロジェクト: AuthurExcalbern/AI-Snake
    "greedy": "GreedySolver",
    "hamilton": "HamiltonSolver",
    "dqn": "DQNSolver",
}

dict_mode = {
    "normal": GameMode.NORMAL,
    "bcmk": GameMode.BENCHMARK,
    "train_dqn": GameMode.TRAIN_DQN,
    "train_dqn_gui": GameMode.TRAIN_DQN_GUI,
}

parser = argparse.ArgumentParser(description="Run snake game agent.")
parser.add_argument(
    "-s",
    default="greedy",
    choices=dict_solver.keys(),
    help="name of the solver to direct the snake (default: hamilton)")
parser.add_argument("-m",
                    default="normal",
                    choices=dict_mode.keys(),
                    help="game mode (default: normal)")
args = parser.parse_args()

conf = GameConf()
conf.solver_name = dict_solver[args.s]
conf.mode = dict_mode[args.m]
print("Solver: %s    Mode: %s" % (conf.solver_name, conf.mode))

Game(conf).run()
コード例 #3
0
from snake.game import Game, GameConf, GameMode

greedy = "GreedySolver"
hamilton = "HamiltonSolver"

normal = GameMode.NORMAL

conf = GameConf()
conf.solver_name = greedy
conf.mode = normal
print("Solver: %s " % (conf.solver_name))
print("Mode: %s" % (conf.mode))
Game(conf).run()
コード例 #4
0
ファイル: run.py プロジェクト: auhsoja/complex-final
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=C0103,C0111

from snake.game import GameConf, Game


conf = GameConf()

conf.solver_name = "NeuralSolver"
#conf.solver_name = "HamiltonSolver"
#conf.solver_name = "GreedySolver"


Game(conf).run()
コード例 #5
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=C0103,C0111
import sys
from snake.game import Game, GameConf, GameMode

sys.tracebacklimit = 0
dict_solver = {
    "g": "GreedySolver",
    "h": "HamiltonSolver",
}

dict_mode = {
    "n": GameMode.NORMAL,
    "b": GameMode.BENCHMARK,
}

conf = GameConf()
conf.solver_name = dict_solver["g"]
conf.mode = dict_mode["b"]
print("Solver: %s    Mode: %s" % (conf.solver_name, conf.mode))

Game(conf).run()
コード例 #6
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=C0103,C0111

from snake.game import GameConf, Game

conf = GameConf()

conf.solver_name = "HamiltonSolver"
#conf.solver_name = "GreedySolver"

Game(conf).run()
コード例 #7
0
ファイル: run.py プロジェクト: chuyangLiu/Snake-AI
import argparse

from snake.game import Game, GameConf, GameMode

dict_solver = {
    "greedy": "GreedySolver",
    "hamilton": "HamiltonSolver",
    "dqn": "DQNSolver",
}

dict_mode = {
    "normal": GameMode.NORMAL,
    "bcmk": GameMode.BENCHMARK,
    "train_dqn": GameMode.TRAIN_DQN,
    "train_dqn_gui": GameMode.TRAIN_DQN_GUI,
}

parser = argparse.ArgumentParser(description="Run snake game agent.")
parser.add_argument("-s", default="hamilton", choices=dict_solver.keys(),
                    help="name of the solver to direct the snake (default: hamilton)")
parser.add_argument("-m", default="normal", choices=dict_mode.keys(),
                    help="game mode (default: normal)")
args = parser.parse_args()

conf = GameConf()
conf.solver_name = dict_solver[args.s]
conf.mode = dict_mode[args.m]
print("Solver: %s    Mode: %s" % (conf.solver_name, conf.mode))

Game(conf).run()