Skip to content

Commit

Permalink
Allow load shifting input and output capacity to be set independent f…
Browse files Browse the repository at this point in the history
…rom each other (#1380)

* Make load shifting use new input_capacity_from_share attribute to calculate input_capacity (uses local Atlas gem!)

* Filter out NaN values

* Revert using local Atlas gem

* Use latest version of Atlas

* Revert filtering out NaN values

* Revert changes to Qernel::Node

* Minor change to load_shifting_adapter comment

* Bump Atlas to quintel/atlas@2db914b

---------

Co-authored-by: Mathijs Bijkerk <[email protected]>
  • Loading branch information
thomas-qah and mabijkerk authored Dec 19, 2023
1 parent eed360a commit 6d66a0d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ gem 'ruby-progressbar'

# own gems
gem 'quintel_merit', ref: '421f3fb', github: 'quintel/merit'
gem 'atlas', ref: 'f7aebb9', github: 'quintel/atlas'
gem 'atlas', ref: '2db914b', github: 'quintel/atlas'
gem 'fever', ref: 'bf092b2', github: 'quintel/fever'
gem 'refinery', ref: '72eacf8', github: 'quintel/refinery'
gem 'rubel', ref: 'e36554a', github: 'quintel/rubel'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ GIT

GIT
remote: https://github.com/quintel/atlas.git
revision: f7aebb944182f7b92fecb5f4188c3354a64c93c6
ref: f7aebb9
revision: 2db914bf62c4b95d5896d2d844f3da9abf7aef3e
ref: 2db914b
specs:
atlas (1.0.0)
activemodel (>= 7)
Expand Down Expand Up @@ -170,7 +170,7 @@ GEM
dry-validation (~> 1.0, >= 1.0.0)
connection_pool (2.4.1)
crass (1.0.6)
csv (3.2.7)
csv (3.2.8)
dalli (3.2.3)
debug_inspector (1.1.0)
deep_merge (1.2.2)
Expand Down
7 changes: 4 additions & 3 deletions app/models/qernel/merit_facade/load_shifting_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def inject!

# TODO: Set input and output capacities.
target_api.typical_input_capacity = input_capacity
target_api.electricity_output_capacity = input_capacity
target_api.electricity_output_capacity = output_capacity

inject_curve!(:input) do
main_participant.load_curve.map { |v| v.negative? ? v.abs : 0.0 }
Expand Down Expand Up @@ -80,11 +80,12 @@ def limiting_curve

def input_capacity
# The input capacity will be further affected in Merit by the availability of the node.
@input_capacity ||= limiting_curve.max
@input_capacity = (@config.input_capacity_from_share || 0.0) * output_capacity
end

def output_capacity
input_capacity
# The output capacity will be further affected in Merit by the availability of the node.
@output_capacity ||= limiting_curve.max
end

# Finds all the participants for the nodes named in the `demand_sources` config attribute.
Expand Down

0 comments on commit 6d66a0d

Please sign in to comment.