Fixup start costs#696
Conversation
bd98178 to
228ccb5
Compare
228ccb5 to
dd45234
Compare
dd45234 to
784d1b1
Compare
| Returns: | ||
| The volume of the unit within the given time range. | ||
| """ | ||
| self.calculate_generation_cost(start, end, "energy") |
There was a problem hiding this comment.
Did someone do a performance check here? I remember that we explictly did not recalcuate the marginal costs becasue it was slowing down the simualtio quite a bit.
There was a problem hiding this comment.
I checked it shortly with example_03 and did not see a huge performance decrease - but would like to investigate this further
| For storages, "operating" means ``outputs["energy"] > 0``, i.e. | ||
| actively discharging. Charging and idle steps count as off. The |
There was a problem hiding this comment.
So Charging cannot have ramping constraints or costs?
There was a problem hiding this comment.
This is not about ramping - it is about start cost - so a price one would pay per start of the hydro-storage-turbines.
I actually think that start_cost do not really make sense for storages, especially batteries and would leave this option for powerplants only?
An alternative is to model the storage with a cycling cost with opexPerChargeOperation and opexPerDischargeOperation as done in FINE:
https://github.com/FZJ-IEK3-VSA/FINE/blob/1b6c40cc56bc790cf15cf69de19847725d42185a/fine/storage.py#L51
- AMIRIS does not have something like this from what I have seen.
| if output != 0 and op_time < 0: | ||
| start_up_cost = unit.get_starting_costs(op_time) | ||
| costs[i] += start_up_cost | ||
| # TODO not available yet as generation costs are calculated afterwards |
There was a problem hiding this comment.
If function is truly idempotent than why not call it after the bid fomrualtion as well, and after the dispatch they are overwritten?
There was a problem hiding this comment.
idempotent means that it does not break anything, but it still costs performance to caculate it here as well.
But yes, maybe calling it here would solve it.
| # Start-up cost is already booked idempotently into | ||
| # outputs[f"{product_type}_start_costs"] by _book_start_costs in | ||
| # execute_current_dispatch. Read from there instead of recomputing. | ||
| operational_cost += unit.outputs[f"{product_type}_start_costs"].at[start] |
There was a problem hiding this comment.
Why did you not carry over the "/2"?
784d1b1 to
2cc2f1b
Compare
2cc2f1b to
b6f84b2
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #696 +/- ##
==========================================
+ Coverage 81.99% 82.17% +0.17%
==========================================
Files 56 56
Lines 9094 9089 -5
==========================================
+ Hits 7457 7469 +12
+ Misses 1637 1620 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b6f84b2 to
fcc15cf
Compare
PR Reviewer Guide 🔍(Review updated until commit 26c8dde)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 26c8dde
Previous suggestionsSuggestions up to commit fcc15cf
|
This corrects an issue with the current calculation but might introduce a changed learning behavior
fcc15cf to
26c8dde
Compare
|
Persistent review updated to latest commit 26c8dde |
|
|
||
| if start <= self.index[0]: | ||
| # before start of index | ||
| # this assumes that all powerplants are running at the start of the simulation |
There was a problem hiding this comment.
first I thought this was a good assumption, but I'm not sure anymore because it doesn't account for the initial start-up costs for this ... but at least it's now clearly documented

User description
Related Issue
relates to #695
Description
This fixes calculation of start costs by using
get_starting_costsinexecute_current_dispatch.This also restructures
calculate_generation_costto be part ofexecute_current_dispatchas this in the "general" part which should be part of all the specific implementations.However, this still needs some fixes in the various strategies, I guess.
Checklist
docfolder updates etc.)Additional Notes (optional)
PR Type
Bug fix, Enhancement, Tests, Documentation
Description
Book start-up costs from final dispatch
Make cost booking idempotent across markets
Update rewards to reuse booked costs
Add tests and dashboard/outputs updates
Diagram Walkthrough
File Walkthrough
3 files
Trigger cost calc and improve operation lookbackInclude start costs in dispatched outputsRemove storage startup costs and recompute generation costs3 files
Read booked costs to avoid double countingReplace recomputed startup costs with booked seriesAdd idempotent start-cost booking and lookback3 files
Clarify idempotent generation-cost behavior in testsAdd comprehensive startup-cost booking test suiteRemove downtime warm/hot validation test cases2 files
Show start-up costs and profit correctlyDocument `energy_start_costs` in unit outputs