Driving Gen

../../_images/driving_gen.gif

This environment is part of the Grid World environments. Please read that page first for general information.

Possible Agents

(‘0’, ‘1’)

Action Spaces

{‘0’: Discrete(5), ‘1’: Discrete(5)}

Observation Spaces

{‘0’: Tuple(Tuple(Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4)), Discrete(4), Tuple(Discrete(14), Discrete(14)), Tuple(Discrete(14), Discrete(14)), Discrete(2), Discrete(2)), ‘1’: Tuple(Tuple(Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4), Discrete(4)), Discrete(4), Tuple(Discrete(14), Discrete(14)), Tuple(Discrete(14), Discrete(14)), Discrete(2), Discrete(2))}

Symmetric

True

Import

posggym.make("DrivingGen-v1")

The Generated Driving Grid World Environment.

This is the same as the Driving Environment except that a new grid is generated at each reset.

For environment attributes see Driving environment class documentation.

Arguments

  • num_agents - the number of agents in the environment (default = 2).

  • obs_dim - the local observation dimensions, specifying how many cells in front, behind, and to each side the agent observes (default = (3, 1, 1), resulting in the agent observing a 5x3 area: 3 in front, 1 behind, 1 to each side.)

  • generator_params - the parameters to use for generating the grid (default = “14x14”). This can either be a string specyfing one of the supported sets of params (can be “7x7”, “14x14”, “28x28”) or a dictionary with the following keys:

    • width - width of the grid

    • height - height of the grid

    • max_obstacle_size - max size of an obstacle

    • max_num_obstacles - maximum number of obstacles in the grid

  • n_grids - the number of different grids to generate, if provided then n_grids will be generated and these will be cycled through for each reset. If None then a different, possibly unique, grid will be generated each episode (default = None).

  • shuffle_grid_order - whether to shuffle the order in which different grids appear. Only has any effect if n_grids > 1 (default = True).

Available variants

The DrivingGen environment comes with a number of pre-built sets of grid generator parameters which can be passed as an argument to posggym.make:

Name

Grid size

max obstacle size

max num obstacles

7x7

7x7

2

21

14x14

14x14

3

42

28x28

28x28

4

84

For example to use the DrivingGen environment with the pre-build 7x7 set of generation parameters and 2 agents, you would use:

import posggym
env = posggym.make('DrivingGen-v1', generator_params="7x7", num_agents="2")

Version History

  • v1: Updated to Driving-v1 (See Version history of Driving environment for details).

  • v0: Initial version