sinergym.utils.logger.LoggerStorage
- class sinergym.utils.logger.LoggerStorage
Logger storage for agent interaction with environment. Save all interactions in list or list of lists as attributes.
- observations
List to store observations.
- Type:
List[List[float]]
- normalized_observations
List to store normalized observations (if exists).
- Type:
List[List[float]]
- actions
List to store agent actions.
- Type:
List[Union[int, np.ndarray, List[float]]]
- rewards
List to store rewards.
- Type:
List[float]
- infos
List to store info data.
- Type:
List[Dict[str, Any]]
- terminateds
List to store terminated flags.
- Type:
List[bool]
- truncateds
List to store truncated flags.
- Type:
List[bool]
- __init__()
Logger constructor.
Methods
__init__
()Logger constructor.
log_info
(info)Log info data.
log_interaction
(obs, action, reward, info, ...)Log interaction data.
log_norm_obs
(norm_obs)Log normalized observation data.
log_obs
(obs)Log observation data.
Reset logger interactions data
- log_info(info: Dict[str, Any]) None
Log info data.
- Parameters:
info (Dict[str, Any]) – Info data.
- log_interaction(obs: List[float], action: int | ndarray | List[float], reward: float, info: Dict[str, Any], terminated: bool, truncated: bool, custom_metrics: List[Any] | None = None) None
Log interaction data.
- Parameters:
obs (List[float]) – Observation data.
action (Union[int, np.ndarray, List[float]]) – Action data.
reward (float) – Reward data.
info (Dict[str, Any]) – Info data.
terminated (bool) – Termination flag.
truncated (bool) – Truncation flag.
custom_metrics (List[Any]) – Custom metric data. Default is None.
- log_norm_obs(norm_obs: List[float]) None
Log normalized observation data.
- Parameters:
norm_obs (List[float]) – Normalized observation data.
- log_obs(obs: List[float]) None
Log observation data.
- Parameters:
obs (List[float]) – Observation data.
- reset_data() None
Reset logger interactions data