Skip to content

Comments

Change objective normalization in weighted_sum decision method#449

Merged
tsmbland merged 7 commits intodevelopfrom
weighted_sum
Aug 14, 2024
Merged

Change objective normalization in weighted_sum decision method#449
tsmbland merged 7 commits intodevelopfrom
weighted_sum

Conversation

@tsmbland
Copy link
Collaborator

@tsmbland tsmbland commented Aug 9, 2024

Description

This changes the normalization in the weighted-sum decision method. Instead of normalizing objectives to [0,1] by subtracting the minimum and dividing by the maximum, we're now just dividing by the (absolute) maximum. See this comment for why I think this is a good idea.

There are probably other ways that this could be done, so happy to have a discussion about this.

Demonstrated below for the "LCOE" and "consumption" objectives

Single objectives:
capacity_lcoe
capacity_consumption

Multiple objectives with weighted sum (before):
multi_objective_50_LCOE_50_consumption
multi_objective_100_LCOE_0_consumption
multi_objective_0_LCOE_100_consumption

Multiple objectives with weighted sum (new):
multi_objective_50_LCOE_50_consumption
multi_objective_100_LCOE_0_consumption
multi_objective_0_LCOE_100_consumption

With the new normalization method the behaviour looks much more in line with expectations (intermediate behaviour with 0.5/0.5 and equal to the single objective scenarios with 1/0 and 0/1)

I've also changed the tutorial models to use the "fuel_consumption_cost" objective instead of the EAC objective. I would have done this as a separate PR, but had to do it here as the original model didn't work with the changes I've made to the weighted sum method (it would jump between two solutions in the MCA and never converge). I think (hope) this is unrelated to the changes I've made to the weighted sum and just something that can happen sometimes. In any case, I think the "fuel_consumption_cost" is better for the tutorial as it has more contrast with the LCOE objective. See updated version here

Fixes #317
Fixes #337

Type of change

Please add a line in the relevant section of
CHANGELOG.md to
document the change (include PR #) - note reverse order of PR #s.

  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass: $ python -m pytest
  • The documentation builds and looks OK: $ python -m sphinx -b html docs docs/build

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.27%. Comparing base (0f1f518) to head (86e30d8).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #449      +/-   ##
===========================================
- Coverage    71.28%   71.27%   -0.01%     
===========================================
  Files           44       44              
  Lines         5885     5884       -1     
  Branches      1154     1154              
===========================================
- Hits          4195     4194       -1     
  Misses        1369     1369              
  Partials       321      321              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tsmbland tsmbland marked this pull request as ready for review August 12, 2024 08:22
@tsmbland tsmbland requested a review from dalonsoa August 12, 2024 08:24
Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good! A very small change, a very big impact. I think the whole explanation of why this normalisation makes sense is solid, so happy with the changes.

@tsmbland
Copy link
Collaborator Author

This looks really good! A very small change, a very big impact. I think the whole explanation of why this normalisation makes sense is solid, so happy with the changes.

Great, thanks!

@tsmbland tsmbland enabled auto-merge August 14, 2024 08:27
@tsmbland tsmbland merged commit 61b0983 into develop Aug 14, 2024
@tsmbland tsmbland deleted the weighted_sum branch August 14, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Tutorial 8.2 - over-investment with EAC objective and problems with weighted sum Unexpected behaviour with the weighted_sum decision method [BUG]

2 participants