ugr-sail / sinergym

Gym environment for building simulation and control using reinforcement learning
https://ugr-sail.github.io/sinergym/
MIT License
127 stars 34 forks source link

(v3.1.3) - Sinergym ActionWrappers adaptation for SB3 algorithm #379

Closed AlejandroCN7 closed 8 months ago

AlejandroCN7 commented 8 months ago

Description

This is a little fix for Sinergym's action wrappers in order to adapt it to the SB3 algorithms.

Motivation and Context

Why is this change required? What problem does it solve? Please, reference issue or issues opened previously.

The current ActionWrappers work perfectly with Gymnasium. However, there was a bug with SB3 algorithms. The action Wrappers update the action before to send it to the next layer. SB3 copy the last layer action value instead the action used in the network input (which is translated in errors). To avoid this, the action parsers copy do a copy of the original action before to start to manipulate it.

Types of changes

Checklist:

Changelog: