Skip to content

Commit

Permalink
[HOTFIX]: DatetimeWrapper: Added -1 in month cos and sin due to its r…
Browse files Browse the repository at this point in the history
…ange [1,12] instead of [0,11]
  • Loading branch information
AlejandroCN7 committed Apr 17, 2023
1 parent ffc560d commit 9b90bee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sinergym/utils/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ def observation(self, obs: np.ndarray) -> np.ndarray:
new_obs['is_weekend'] = 1.0 if dt.isoweekday() in [6, 7] else 0.0
new_obs['hour_cos'] = np.cos(2 * np.pi * obs_dict['hour'] / 24)
new_obs['hour_sin'] = np.sin(2 * np.pi * obs_dict['hour'] / 24)
new_obs['month_cos'] = np.cos(2 * np.pi * obs_dict['month'] / 12)
new_obs['month_sin'] = np.sin(2 * np.pi * obs_dict['month'] / 12)
new_obs['month_cos'] = np.cos(2 * np.pi * (obs_dict['month'] - 1) / 12)
new_obs['month_sin'] = np.sin(2 * np.pi * (obs_dict['month'] - 1) / 12)

return np.array(list(new_obs.values()))

Expand Down

0 comments on commit 9b90bee

Please sign in to comment.