Skip to content

Latest commit

 

History

History
103 lines (78 loc) · 1.71 KB

game_interface.md

File metadata and controls

103 lines (78 loc) · 1.71 KB

[Game Interface](@id game_interface)

CurrentModule = AlphaZero
GameInterface

A test suite is provided in the AlphaZero.Scripts to check the compliance of your environment with this interface.

CurrentModule = AlphaZero.GameInterface

Mandatory Interface

The game interface of AlphaZero.jl differs from many standard RL interfaces by making a distinction between a game specification and a game environment:

  • A specification holds all static information about a game, which does not depend on the current state (e.g. the world dimensions in a grid world environment)
  • In contrast, an environment holds information about the current state of the game (e.g. the player's position in a grid-world environment).

Game Specifications

AbstractGameSpec
two_players
actions
vectorize_state

Game Environments

AbstractGameEnv
init
spec
set_state!
current_state
game_terminated
white_playing
actions_mask
play!
white_reward

Optional Interface

Interface for Interactive Tools

These functions are required for the default [User Interface](@ref ui) to work well.

action_string
parse_action
read_state
render

Other Optional Functions

heuristic_value
symmetries

Derived Functions

Operations on Specifications

state_type
state_dim
state_memsize
action_type
num_actions
init(::AbstractGameSpec, state)

Operations on Environments

clone
available_actions
apply_random_symmetry!

[Wrapper for CommonRLInterface.jl](@id common_rl_intf)

CurrentModule = AlphaZero
CommonRLInterfaceWrapper
CommonRLInterfaceWrapper.Env
CommonRLInterfaceWrapper.Spec