Python environment API
The Python module deepmind_lab
defines the Lab
class. For example usage, there is python/tests/dmlab_module_test.py,python/random_agent.py, and python/random_agent_simple.py.
class deepmind_lab.Lab
(level, observations, config={}, renderer='software')
Creates an environment object, loading the game script file level. The environment's observations
() method will return the observations specified by name in the list observations.
The config
dict specifies additional settings as key-value string pairs. The following options are recognized:
Option | Description | Default |
---|---|---|
width |
horizontal resolution of the observation frames | '320' |
height |
vertical resolution of the observation frames | '240' |
fps |
frames per second | '60' |
appendCommand |
Commands for the internal Quake console* | '' |
* See also Lua map API.
Unrecognized options are passed down to the level's init function. In Lua, this is kwargs.opts
in api:init
.
For example, you can run a modified version of the lt_chasm level with these calls,
import deepmind_lab
observations = ['RGBD']
env = deepmind_lab.Lab('lt_chasm', observations,
config={
'width':