plangym.control.box_2d
Implement the plangym
API for Box2D environments.
Module Contents
Classes
Extract state information from Box2D environments. |
|
Common interface for working with Box2D environments released by gym. |
- class plangym.control.box_2d.Box2DState[source]
Extract state information from Box2D environments.
This class implements basic functionalities to get the necessary elements to construct a Box2D state.
- static get_body_attributes(body)[source]
Return a dictionary containing the attributes of a given body.
Given a
Env.world.body
element, this method constructs a dictionary whose entries describe all body attributes.- Return type
dict
- classmethod serialize_body_state(cls, state_dict)[source]
Serialize the state of the target body data.
This method takes as argument the result given by the method
self.get_body_attributes
, the latter consisting in a dictionary containing all attribute elements of a body. The method returns a dictionary whose values are the serialized attributes of the body.
- classmethod set_body_state(cls, body, state)[source]
Set the state to the target body.
The method defines the corresponding body attribute to the value selected by the user.
- classmethod serialize_body(cls, body)[source]
Serialize the data of the target
Env.world.body
instance.
- classmethod serialize_world_state(cls, world)[source]
Serialize the state of all the bodies in world.
The method serializes all body elements contained within the given
Env.world
object.
- class plangym.control.box_2d.Box2DEnv(name, frameskip=1, autoreset=True, wrappers=None, delay_setup=False, remove_time_limit=True, render_mode=None, episodic_life=False, obs_type=None, return_image=False, **kwargs)[source]
Bases:
plangym.core.PlangymEnv
Common interface for working with Box2D environments released by gym.
- Parameters
name (str) –
frameskip (int) –
autoreset (bool) –
wrappers (Iterable[wrap_callable]) –
delay_setup (bool) –
render_mode (Optional[str]) –