commonpower.control.wrappers.RecordTransitionsWrapper
- class RecordTransitionsWrapper(env: ControlEnv, scenario_id: str, run_config: dict, seed: int, tuple_db: TupleDB, buffer_size: int = 100, write_buffer_on_done: bool = True)[source]
Bases:
WrapperWrapper for recording transition tuples (s,a,s’,r) either to current disk or to a data base. NOTE: Currently only available for single-agent RL!
- Parameters:
env (gym.Env) – The gym environment to be wrapped.
tuple_db (TupleDB) – The database for storing the transition tuples.
buffer_size (int, optional) – The maximum size of the tuple buffer. Defaults to 100.
write_buffer_on_done (bool, optional) – Whether to always write out the buffer on a done state. Defaults to True.
Methods
class_nameReturns the class name of the wrapper.
closeCloses the wrapper and
env.get_wrapper_attrGets an attribute from the wrapper and lower environments if name doesn't exist in this object.
renderUses the
render()of theenvthat can be overwritten to change the returned data.Uses the
reset()of theenvthat can be overwritten to change the returned data.Uses the
step()of theenvthat can be overwritten to change the returned data.wrapper_specGenerates a WrapperSpec for the wrappers.
Attributes
action_spaceReturn the
Envaction_spaceunless overwritten then the wrapperaction_spaceis used.metadataReturns the
Envmetadata.np_randomReturns the
Envnp_randomattribute.observation_spaceReturn the
Envobservation_spaceunless overwritten then the wrapperobservation_spaceis used.render_modeReturns the
Envrender_mode.reward_rangeReturn the
Envreward_rangeunless overwritten then the wrapperreward_rangeis used.specReturns the
Envspecattribute with the WrapperSpec if the wrapper inherits from EzPickle.unwrappedReturns the base environment of the wrapper.