assume-framework / assume

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

Contract Market with feed in policy and market premium #248

Closed maurerle closed 6 months ago

maurerle commented 10 months ago

This PR implements a feed in policy, which calculates the value a special demand agent pays on top of the market prices as a feed-in-tariff. The contract is accepted on a monthly base for example, and evaluated on a weekly base. For this, the generation and market_price of the last week is requested using the data_request mechanism developed in #247 - then the resulting orderbook is created and sent to the contract participants using the already existing clearing process.

This works in general, though the results are not correct yet. I think the volume and price is applied for the whole series and the dashboard needs some polishment too.

codecov[bot] commented 10 months ago

Codecov Report

Attention: Patch coverage is 30.18868% with 148 lines in your changes are missing coverage. Please review.

Project coverage is 78.53%. Comparing base (dbd53ad) to head (2747bd7).

Files Patch % Lines
assume/markets/clearing_algorithms/contracts.py 31.31% 125 Missing :warning:
assume/strategies/extended.py 20.68% 23 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #248 +/- ## ========================================== - Coverage 79.86% 78.53% -1.33% ========================================== Files 41 42 +1 Lines 4704 4916 +212 ========================================== + Hits 3757 3861 +104 - Misses 947 1055 +108 ``` | [Flag](https://app.codecov.io/gh/assume-framework/assume/pull/248/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/248/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | `78.53% <30.18%> (-1.33%)` | :arrow_down: | 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.

nick-harder commented 9 months ago

@maurerle why do you believe the feed-in premium should be handled by an extra demand agent, ant not an additional market party? Also, it would be better to add functionality when it is 100% operational and tested. So please same here, check functionality, and add tests for the new market clearing algorithms. Thanks :-)

nick-harder commented 7 months ago

@maurerle is this now ready?

maurerle commented 7 months ago

I'd still like to add some tests - but I don't think that I find time this week. So we can merge this :)

nick-harder commented 7 months ago

@maurerle there is also no description of the new methods, no docstrings, and any mention of the new clearings in the documentation. It would be helpful to have them. Let's merge when tests and documentation are there, it can wait :-)