catanatron_gym package#
Subpackages#
Submodules#
catanatron_gym.features module#
- catanatron_gym.features.build_production_features(consider_robber)#
- catanatron_gym.features.count_production(nodes, catan_map)#
- catanatron_gym.features.create_sample(game, p0_color)#
- catanatron_gym.features.create_sample_vector(game, p0_color, features=None)#
- catanatron_gym.features.get_feature_ordering(num_players=4, map_type: Literal['BASE', 'MINI', 'TOURNAMENT'] = 'BASE')#
- catanatron_gym.features.get_node_hot_encoded(player_index, colors, settlements, cities, roads)#
- catanatron_gym.features.get_node_production(catan_map, node_id, resource)#
- catanatron_gym.features.get_owned_or_buildable(game, color, board_buildable)#
- catanatron_gym.features.get_zero_nodes(game, color)#
- catanatron_gym.features.is_building(game, node_id, color, building_type)#
- catanatron_gym.features.is_road(game, edge, color)#
- catanatron_gym.features.iter_level_nodes(enemy_nodes, enemy_roads, num_roads, zero_nodes)#
Iterates over possible expansion paths.
- Parameters
enemy_nodes (frozenset[NodeId]) – node_ids owned by enemy colors
enemy_roads (frozenset[EdgeId]) – edge_ids owned by enemy colors
num_roads (int) – Max-depth of BFS (inclusive). e.g. 2 will yield possible expansions with up to 2 roads.
zero_nodes (frozenset[NodeId]) – Nodes reachable per board.connected_components
- Yields
Tuple[int, Set[NodeId], Dict[NodeId, List[EdgeId]] – First element is level (roads needed to get there). Second element is set of node_ids reachable at this level. Third is mapping of NodeId to the list of edges that leads to shortest path to that NodeId.
- catanatron_gym.features.iter_players(colors: Tuple[Color], p0_color: Color)#
Iterator: for i, player in iter_players(game, p0.color)
- catanatron_gym.features.map_port_features(catan_map)#
- catanatron_gym.features.port_features(game, p0_color)#