assume-framework / assume

ASSUME - Agent-based Simulation for Studying and Understanding Market Evolution
https://assume.readthedocs.io
20 stars 5 forks source link

Adjust the framework to be able to schedule storing to the learning role #375

Closed nick-harder closed 2 weeks ago

nick-harder commented 2 weeks ago

To be able to simulate several markets using one single RL agents we need to be able to save the rewards only after all the modeled markets have been cleared and the final reward has been calculated. This PR brings the required changes to the framework by scheduling the saving to the buffer and policy updates every train_freq. If train_freq is configured to match the closure of all modelled markets, the correct rewards is sved, thus enabling to model several market with one RL agent.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 91.30435% with 8 lines in your changes missing coverage. Please review.

Project coverage is 77.96%. Comparing base (1b430ff) to head (ce8c055).

:exclamation: Current head ce8c055 differs from pull request most recent head 23a7ac9

Please upload reports for the commit 23a7ac9 to get more accurate results.

Files Patch % Lines
assume/common/units_operator.py 91.52% 5 Missing :warning:
assume/strategies/__init__.py 71.42% 2 Missing :warning:
assume/strategies/learning_advanced_orders.py 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #375 +/- ## ========================================== + Coverage 74.92% 77.96% +3.04% ========================================== Files 43 43 Lines 5120 5129 +9 ========================================== + Hits 3836 3999 +163 + Misses 1284 1130 -154 ``` | [Flag](https://app.codecov.io/gh/assume-framework/assume/pull/375/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | Coverage Δ | | |---|---|---| | [pytest](https://app.codecov.io/gh/assume-framework/assume/pull/375/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | `77.96% <91.30%> (+3.04%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.