Пример #1
0
def human_against_ismcts(target_points: int):
    agents = [
        HumanInputAgent(position=0),
        make_ismcts_agent(),
        make_ismcts_agent(),
        make_ismcts_agent()
    ]
    game = TichuGame(*agents)

    res = game.start_game(target_points=target_points)
    return res
Пример #2
0
def human_against_ismcts(target_points: int):
    def make_agent():
        return BaseMonteCarloAgent(
                    make_best_ismctsearch(name='Best'),
                    iterations=100000, max_time=10, cheat=False
            )
    agents = [HumanInputAgent(position=0), make_agent(), make_agent(), make_agent()]
    game = TichuGame(*agents)

    res = game.start_game(target_points=target_points)
    return res
def human_against_random(target_points: int):
    agents = [
        HumanInputAgent(position=0),
        RandomAgent(),
        RandomAgent(),
        RandomAgent()
    ]
    game = TichuGame(*agents)

    res = game.start_game(target_points=target_points)
    return res
Пример #4
0
def ismcts_against_ismcts(target_points: int):

    agents = [
        make_ismcts_agent(),
        make_ismcts_agent(),
        make_ismcts_agent(),
        make_ismcts_agent()
    ]
    game = TichuGame(*agents)

    res = game.start_game(target_points=target_points)
    return res
Пример #5
0
    def _run_game(self, target_points=1000):

        game = TichuGame(*self.agents)
        return game.start_game(target_points=target_points)
Пример #6
0
def create_agent_against_agent(type1, type2) -> TichuGame:
    agents = [type1(), type2(), type1(), type2()]
    return TichuGame(*agents)