mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 00:08:52 -06:00
AELMP: Convert warnings into errors; update docstrings
This commit is contained in:
@@ -24,8 +24,8 @@ Returns a dictionary mapping `(bus_name, time)` to the marginal price.
|
|||||||
WARNING: This approximation method is not fully developed. The implementation is based on MISO Phase I only.
|
WARNING: This approximation method is not fully developed. The implementation is based on MISO Phase I only.
|
||||||
|
|
||||||
1. It only supports Fast Start resources. More specifically, the minimum up/down time has to be zero.
|
1. It only supports Fast Start resources. More specifically, the minimum up/down time has to be zero.
|
||||||
2. The method does NOT support time series of start-up costs.
|
2. The method does NOT support time-varying start-up costs.
|
||||||
3. The method can only calculate for the first time slot if allow_offline_participation=false.
|
3. AELMPs are only calculated for the first time period if offline participation is not allowed.
|
||||||
|
|
||||||
Arguments
|
Arguments
|
||||||
---------
|
---------
|
||||||
@@ -80,10 +80,9 @@ function compute_lmp(
|
|||||||
method::AELMP;
|
method::AELMP;
|
||||||
optimizer,
|
optimizer,
|
||||||
)::OrderedDict{Tuple{String,Int},Float64}
|
)::OrderedDict{Tuple{String,Int},Float64}
|
||||||
@info "Calculating the AELMP..."
|
|
||||||
@info "Building the approximation model..."
|
@info "Building the approximation model..."
|
||||||
instance = deepcopy(model[:instance])
|
instance = deepcopy(model[:instance])
|
||||||
_preset_aelmp_parameters!(method, model)
|
_aelmp_check_parameters(method, model)
|
||||||
_modify_instance!(instance, model, method)
|
_modify_instance!(instance, model, method)
|
||||||
|
|
||||||
# prepare the result dictionary and solve the model
|
# prepare the result dictionary and solve the model
|
||||||
@@ -112,36 +111,16 @@ function compute_lmp(
|
|||||||
return elmp
|
return elmp
|
||||||
end
|
end
|
||||||
|
|
||||||
function _preset_aelmp_parameters!(
|
function _aelmp_check_parameters(
|
||||||
method::AELMP,
|
method::AELMP,
|
||||||
model::JuMP.Model
|
model::JuMP.Model
|
||||||
)
|
)
|
||||||
# this function corrects the allow_offline_participation parameter to match the model status
|
|
||||||
# CHECK: model must be solved if allow_offline_participation=false
|
# CHECK: model must be solved if allow_offline_participation=false
|
||||||
if method.allow_offline_participation # do nothing
|
if !method.allow_offline_participation
|
||||||
@info "Offline generators are allowed to participate in pricing."
|
if isnothing(model) || !has_values(model)
|
||||||
else
|
error("A solved UC model is required if allow_offline_participation=false.")
|
||||||
if isnothing(model)
|
|
||||||
@warn "No UC model is detected. A solved UC model is required if allow_offline_participation == false."
|
|
||||||
@warn "Setting parameter allow_offline_participation = true"
|
|
||||||
method.allow_offline_participation = true # and do nothing else
|
|
||||||
elseif !has_values(model)
|
|
||||||
@warn "The UC model has no solution. A solved UC model is required if allow_offline_participation == false."
|
|
||||||
@warn "Setting parameter allow_offline_participation = true"
|
|
||||||
method.allow_offline_participation = true # and do nothing else
|
|
||||||
else
|
|
||||||
# the inputs are correct
|
|
||||||
@info "Offline generators are NOT allowed to participate in pricing."
|
|
||||||
@info "Offline generators will be removed for the approximation."
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# CHECK: start up cost consideration
|
|
||||||
if method.consider_startup_costs
|
|
||||||
@info "Startup costs are considered."
|
|
||||||
else
|
|
||||||
@info "Startup costs are NOT considered."
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function _modify_instance!(
|
function _modify_instance!(
|
||||||
|
|||||||
Reference in New Issue
Block a user