Environment#

class airlift.envs.airlift_env.AirliftEnv(world_generator=None, pickuponly=False, verbose=False, renderer=<airlift.envs.renderer.FlatRenderer object>)

Controls all aspects of the simulation/environment. The primary interface is the step method, which provides observations/states to the agents and steps the environment to the next state given agent actions

action_space(agent: str) Space

Takes in agent and returns the action space for that agent.

MUST return the same value for the same agent name

Default implementation is to return the action_spaces dict

clear_rewards_dict()

Reset the rewards dictionary

close()

This methods closes any renderer window.

property env_info

Returns environment info. Should not be called before the environment is reset.

property metrics

Returns metrics collected by the environment. Note: some values may be incorrect if this is called before the episode is done.

observation_space(agent) Space

Takes in agent and returns the observation space for that agent.

MUST return the same value for the same agent name

Default implementation is to return the observation_spaces dict

render(mode='human')

Displays a rendered frame from the environment, if supported. Alternate render modes in the default environments are ‘rgb_array’ which returns a numpy array and is supported by all environments outside of classic, and ‘ansi’ which returns the strings printed (specific to classic environments).

reset(seed=None) Dict

Resets the environment and generates a new random realization. If called without a seed, a new realization is generated.

Parameters:

seed – Environment seed

Returns:

A dictionary containing the initial observations for all agents. Individual observations of agents can be accessed using the ‘a_0…n’ keys.

state()

Returns the complete state of the environment.

step(actions)

Steps the environment base don the given actions and returns a new observation. Based on the new observation, the policy should create another set of actions for the next step.

Parameters:

actions – Dictionary that contains the actions for all agents

Returns:

obs, Dictionary that contains the observation for all agents. rewards,Dictionary that contains rewards. dones, Dictionary that indicates if an agent has completed a scenario. info, A dictionary containing a list of Warnings for each agent.