Driving Gen
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 |
|
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 gridheight- height of the gridmax_obstacle_size- max size of an obstaclemax_num_obstacles- maximum number of obstacles in the grid
n_grids- the number of different grids to generate, if provided thenn_gridswill be generated and these will be cycled through for each reset. IfNonethen 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 ifn_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 |
2 |
21 |
|
14x14 |
3 |
42 |
|
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 toDriving-v1(See Version history ofDrivingenvironment for details).v0: Initial version