sinergym.utils.wrappers.LoggerWrapper

class sinergym.utils.wrappers.LoggerWrapper(env: Any, flag: bool = True)
__init__(env: Any, flag: bool = True)

CSVLogger to log interactions with environment.

Parameters
  • env (Any) – Original Gym environment.

  • flag (bool, optional) – State of logger (activate or deactivate). Defaults to True.

Methods

__init__(env[, flag])

CSVLogger to log interactions with environment.

activate_logger()

Activate logger if its flag False.

class_name()

close()

Close env.

compute_reward(achieved_goal, desired_goal, info)

deactivate_logger()

Deactivate logger if its flag True.

render([mode])

Renders the environment.

reset()

Resets the environment.

seed([seed])

Sets the seed for this env's random number generator(s).

step(action)

Step the environment.

Attributes

action_space

metadata

observation_space

reward_range

spec

unwrapped

Completely unwrap this env.

activate_logger() None

Activate logger if its flag False.

close() None

Close env. Recording last episode summary.

deactivate_logger() None

Deactivate logger if its flag True.

reset() numpy.ndarray

Resets the environment. Recording episode summary in logger

Returns

First observation given

Return type

np.ndarray

step(action: Union[int, numpy.ndarray]) Tuple[numpy.ndarray, float, bool, Dict[str, Any]]

Step the environment. Logging new information

Parameters

action (Union[int, np.ndarray]) – Action executed in step

Returns

Tuple with next observation, reward, bool for terminated episode and dict with extra information.

Return type

Tuple[np.ndarray, float, bool, Dict[str, Any]]