city_of_gold.vec.env

Vectorized environments

Members

class city_of_gold.vec.env.vec_cog_env_1

Bases: pybind11_object

Vectorized city of gold environment for 1 environments.

vec_cog_env_1.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_1) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_1, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_1, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_128

Bases: pybind11_object

Vectorized city of gold environment for 128 environments.

vec_cog_env_128.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_128) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_128, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_128, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_16

Bases: pybind11_object

Vectorized city of gold environment for 16 environments.

vec_cog_env_16.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_16) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_16, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_16, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_2

Bases: pybind11_object

Vectorized city of gold environment for 2 environments.

vec_cog_env_2.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_2) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_2, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_2, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_256

Bases: pybind11_object

Vectorized city of gold environment for 256 environments.

vec_cog_env_256.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_256) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_256, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_256, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_3

Bases: pybind11_object

Vectorized city of gold environment for 3 environments.

vec_cog_env_3.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_3) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_3, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_3, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_32

Bases: pybind11_object

Vectorized city of gold environment for 32 environments.

vec_cog_env_32.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_32) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_32, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_32, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_4

Bases: pybind11_object

Vectorized city of gold environment for 4 environments.

vec_cog_env_4.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_4) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_4, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_4, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_5

Bases: pybind11_object

Vectorized city of gold environment for 5 environments.

vec_cog_env_5.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_5) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_5, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_5, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_6

Bases: pybind11_object

Vectorized city of gold environment for 6 environments.

vec_cog_env_6.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_6) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_6, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_6, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_64

Bases: pybind11_object

Vectorized city of gold environment for 64 environments.

vec_cog_env_64.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_64) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_64, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_64, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_7

Bases: pybind11_object

Vectorized city of gold environment for 7 environments.

vec_cog_env_7.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_7) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_7, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_7, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents

class city_of_gold.vec.env.vec_cog_env_8

Bases: pybind11_object

Vectorized city of gold environment for 8 environments.

vec_cog_env_8.reset() must be called to initialize the environments before stepping. This also allows setting the parameters for random number generation, number of players, and map generation.

Sets default game parameters:

  • seed: std::random_device()()

  • n_players: 4

  • n_pieces: 3

  • difficulty: Difficulty.EASY

  • max_steps: 100_000

  • render: False

Returns:

The (uninitialized) vectorized environments.

reset(*args, **kwargs)

Overloaded function.

  1. reset(self: city_of_gold.vec.env.vec_cog_env_8) -> None

    Reset all environments, not modifying current parameters

    If no environment parameters have been previously set, the default parameters from when the instance was constructed are used.

    return:

    None

  2. reset(self: city_of_gold.vec.env.vec_cog_env_8, seed: int, n_players: int, n_pieces: int, difficulty: Difficulty, max_steps: int, render: bool) -> None

    Reset all environments using provided parameters

    param seed:

    Set the rng seed

    type seed:

    uint32_t

    param n_players:

    The number of players, with the maximum of 4

    type n_players:

    unsigned char

    param n_pieces:

    Number of map pieces to be used between the starting piece and the end piece when generating the map for the game

    type n_pieces:

    unsigned char

    param difficulty:

    difficulty setting controlling which map pieces are allowed in map generation

    type difficulty:

    city_of_gold.Difficulty

    param max_steps:

    Number of steps before forcing game end

    type max_steps:

    unsigned int

    param render:

    Set to true to render the game in the environments

    type render:

    bool

    return:

    None

step(self: city_of_gold.vec.env.vec_cog_env_8, actions: numpy.ndarray[city_of_gold.ActionData]) None

Advance the environment state according to chosen actions

Parameters:

actions (numpy.ndarray of ActionData) – Actions of the currently active agent in each environment

Returns:

None

property agent_selection

numpy.ndarray[unsigned char]: Current active player in each environment

property dones

numpy.ndarray[bool]: Flag specifying environments with ended games after the previous step

property infos

2D numpy.ndarray of Info: Episode infos of all agents

property num_envs

int: Number of environments

property observations

numpy.ndarray of ObsData: Observations of currently active agents

property rewards

2D numpy.ndarray[float]: Action masks of currently active agents

property selected_action_masks

numpy.ndarray of ActionMask: Action masks of current active agents