Skip to main content

Arelai

Arelai is a framework for creating games and training agents using reinforcement learning (RL). It includes core components like states, actions, observations, and players that can be customized for specific games.

Usage

Using the framework is simple.

  1. Create a Custom Game

    • Subclass State, Action, Observation, and Game to define your game’s rules and mechanics.
  2. Define Players

    • Subclass Player to define how players interact with the game.
  3. Run the Game

    • Create a Game object with players and an initial state, then call the play() method.

Example

class MyState(State):
    # Define the game state

class MyAction(Action):
    # Define an action structure
    
class MyObservation(Observation):
    # Define an observation structure
    

class MyPlayer(Player):
    def get_all_actions(self, state: MyState) -> list[MyAction]:
        # Return a list of actions

    def select_action(self, list[MyAction], observation: MyObservation, simulate_action_fnc: Callable[[Action], Observation]) -> MyAction:
        # Select an action for the player

class MyGame(Game):
    def log(self):
        # Define anything that should be logged for the round

    def terminal(self) -> bool:
        # Define the game-ending condition

    def observe(self, player: MyPlayer, state: MyState) -> MyObservation:
        # Return the observation for the player

    def all_actions(self, player: MyPlayer, state: MyState) -> list[MyAction]:
        # Return all possible actions for the player

    def apply_action(self, state: State, action: Action) -> State:
        # Apply the action profile and return the new state

    def calculate_reward(self,player: Player, old_state: MyState, action: MyAction, new_state: MyState) -> float:
        # Calculate the reward from the environment for the player

Metadata

Release files for arelai 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arelai 0.0.7
File Size Uploaded
arelai-0.0.7.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arelai 0.0.7
File Interpreter ABI Platform
arelai-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / arelai-0.0.7.tar.gz

Download URL arelai-0.0.7.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3936ef36f4bb1d4167c648aab44463ac0067c02053b33c8daea1666bca334b0f
BLAKE2b-256 checksum
How to use checksums
90aa530dd08425c39689862435336befe53f08b5317701fefded3fcbaa106f9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Release files / arelai-0.0.7-py3-none-any.whl

Download URL arelai-0.0.7-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eda8c041f307bf92b13173aa1d4b06bd8f99d85b8de8b657b9a2f821727245db
BLAKE2b-256 checksum
How to use checksums
50f8988a1db487b3a8beb7b8c75cdaa76b121209b7000bb5e77cfc241f4cc268
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page