-
Notifications
You must be signed in to change notification settings - Fork 88
Support multiple group reserve services and add tests #1607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -483,7 +483,7 @@ function add_constraints!( | |
| component_type = typeof(d) | ||
| name = PSY.get_name(d) | ||
| varstatus = get_variable(container, OnVariable(), component_type) | ||
| startup_time = PSY.get_time_limits(d).up | ||
| startup_time = PSY.get_time_limits(d).down | ||
| ramp_limits = _get_ramp_limits(d) | ||
| if reserve_response_time > startup_time | ||
|
Comment on lines
483
to
488
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is somewhat correct. The time_limits(d).up is how much hours the unit needs to be kept on once the OnVariable changes from 0 to 1. It is what is called the minimum start up time time. In here we are using this as how long it takes to be completely turn on. @jd-lara Is it okay to use these two approaches interchangeably here? |
||
| reserve_limit = | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,11 +23,11 @@ function construct_services!( | |
| isempty(services_template) && return | ||
| incompatible_device_types = get_incompatible_devices(devices_template) | ||
|
|
||
| groupservice = nothing | ||
| groupservices = Any[] | ||
|
|
||
| for (key, service_model) in services_template | ||
| if get_formulation(service_model) === GroupReserve # group service needs to be constructed last | ||
| groupservice = key | ||
| if get_formulation(service_model) === GroupReserve # group service needs to be constructed last | ||
| push!(groupservices, key) | ||
| continue | ||
|
Comment on lines
+26
to
31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is okay I guess? @ChenHaotianC You could try to replace with something like: |
||
| end | ||
| isempty(get_contributing_devices(service_model)) && continue | ||
|
|
@@ -41,15 +41,17 @@ function construct_services!( | |
| network_model, | ||
| ) | ||
| end | ||
| groupservice === nothing || construct_service!( | ||
| container, | ||
| sys, | ||
| stage, | ||
| services_template[groupservice], | ||
| devices_template, | ||
| incompatible_device_types, | ||
| network_model, | ||
| ) | ||
| for key in groupservices | ||
| construct_service!( | ||
| container, | ||
| sys, | ||
| stage, | ||
| services_template[key], | ||
| devices_template, | ||
| incompatible_device_types, | ||
| network_model, | ||
| ) | ||
| end | ||
| return | ||
| end | ||
|
|
||
|
|
@@ -64,10 +66,10 @@ function construct_services!( | |
| isempty(services_template) && return | ||
| incompatible_device_types = get_incompatible_devices(devices_template) | ||
|
|
||
| groupservice = nothing | ||
| groupservices = Any[] | ||
| for (key, service_model) in services_template | ||
| if get_formulation(service_model) === GroupReserve # group service needs to be constructed last | ||
| groupservice = key | ||
| if get_formulation(service_model) === GroupReserve # group service needs to be constructed last | ||
| push!(groupservices, key) | ||
| continue | ||
|
Comment on lines
+69
to
73
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
| end | ||
| isempty(get_contributing_devices_map(service_model)) && continue | ||
|
|
@@ -81,15 +83,17 @@ function construct_services!( | |
| network_model, | ||
| ) | ||
| end | ||
| groupservice === nothing || construct_service!( | ||
| container, | ||
| sys, | ||
| stage, | ||
| services_template[groupservice], | ||
| devices_template, | ||
| incompatible_device_types, | ||
| network_model, | ||
| ) | ||
| for key in groupservices | ||
| construct_service!( | ||
| container, | ||
| sys, | ||
| stage, | ||
| services_template[key], | ||
| devices_template, | ||
| incompatible_device_types, | ||
| network_model, | ||
| ) | ||
| end | ||
| return | ||
| end | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChenHaotianC accept this change. This is correct.