sharpie.webserver.experiment.environment_template
Template for an Environment implementation.
This is a basic template showing the expected structure for an environment file. Your environment should define a variable called environment with reset, step, and render methods.
Classes
|
A basic environment wrapper template. |
- class sharpie.webserver.experiment.environment_template.EnvironmentWrapper(env)
A basic environment wrapper template.
- __init__(env)
Initialize the environment.
- reset()
Reset the environment to an initial state.
- Returns:
observation: Initial observation info: Additional information (optional)
- step(action)
Execute one step in the environment. Because this is a multi-agent environment, the action will be a dictionary with agent id as keys and their corresponding actions as values.
- Args:
action: Action to take
- Returns:
observation: New observation reward: Reward for the action terminated: Whether the episode has ended truncated: Whether the episode was truncated info: Additional information
- render()
Render the environment.
- Returns:
image: Rendered image of the environment (or None for text-based rendering)