fights.base#

fights.base.S = ~S#

A type variable for state type with bound BaseState

fights.base.A = ~A#

A type variable for action type with bound ArrayLike

class fights.base.BaseState#

Bases: ABC

abstract static from_dict(serialized) BaseState#

Deserialize from dict.

abstract to_dict() Dict#

Serialize to dict.

abstract property done: bool#

Whether the game is finished.

class fights.base.BaseEnv#

Bases: ABC, Generic[S, A]

abstract property env_id: Tuple[str, int]#

Environment identifier in the form of (name, version).

abstract step(state: S, agent_id: int, action: A, *, pre_step_fn: Callable[[S, int, A], None] | None = None, post_step_fn: Callable[[S, int, A], None] | None = None) S#

Step through the environment.

abstract initialize_state() S#

Initialize state.

class fights.base.BaseAgent(agent_id: int)#

Bases: ABC, Generic[S, A]

abstract property env_id: Tuple[str, int]#

Environment identifier in the form of (name, version).

abstract __init__(agent_id: int) None#

Initialize an agent.

abstract __call__(state: S) A#

Return the calculated agent action based on state input.