Installation and Quickstart Guide

Here you will find instructions regarding how to install the environment, run your first games and implement your first agent!

Instalation

To install ChefsHatGym, you will need python >= 3.10. The environment has a list of requirements that will be installed automatically if you run:

pip install chefshatgym

To use the remote room, which allow you to run your agents from different processes, you need access to a redis server. To install your own redis server, please follow: Redis instalation page.

For Windows users, Memurai is an alternative.

Understanding Chef’s Hat

Chef’s Hat is a card game designed with multimodal and competitive interactions in mind, which allows it to be followed and modeled by artificial agents with ease. It is simple to understand, but difficult to master, rules that provide an excellent opportunity for learning agents. For a complete overview of the development of the game, refer to:

And for a complete understanding of the game’s rules, please check:

Starting a Chef`s Hat Game

To start a game, you can quickly implement a room from the ChefsHatGYM.gameRooms.local_room class.

from ChefsHatGym.gameRooms.chefs_hat_room_local import ChefsHatRoomLocal

room_name = "test_local_room"

room = ChefsHatRoomLocal(
    room_name,
    timeout_player_response=timeout_player_response,
    game_type=game_type,
    stop_criteria=stop_criteria,
    max_rounds=maxRounds,
    verbose=verbose,
)

Once the room is created, you have to add players to it. The Chef`s Hat Gym environment provides a simple random player, that only selects random actions. Using the ChefsHatGym.agents interface, you will be able to create your own agents, and use it in the simulator.

Each agent must have a unique name to be able to play the game.

from ChefsHatGym.agents.agent_random import AgentRandon

p1 = AgentRandon(name="01")
p2 = AgentRandon(name="02")
p3 = AgentRandon(name="03")
p4 = AgentRandon(name="04")

# Adding players to the room
for p in [p1, p2, p3, p4]:
    room.add_player(p)

Once all the players are added to the room, you just have to start the game.

# Start the game
 info = room.start_new_game(game_verbose=True)

 print(f"Performance score: {info['performanceScore']}")
 print(f"Scores: {info['score']}")

A full-running example can be found in the examples folder.