Formatted codes on the LMP dev branch

pull/26/head
Jun He 3 years ago
parent 0b95df25ec
commit 71ed55cb40

@ -124,28 +124,22 @@ function _aelmp_check_parameters(
) )
end end
end end
all_units = instance.units; all_units = instance.units
# CHECK: model cannot handle non-fast-starts (MISO Phase I: can ONLY solve fast-starts) # CHECK: model cannot handle non-fast-starts (MISO Phase I: can ONLY solve fast-starts)
if any(u -> u.min_uptime > 1 || u.min_downtime > 1, all_units) if any(u -> u.min_uptime > 1 || u.min_downtime > 1, all_units)
error( error(
"The minimum up/down time of all generators must be 1. AELMP only supports fast-starts.", "The minimum up/down time of all generators must be 1. AELMP only supports fast-starts.",
) )
end end
if any(u -> u.initial_power > 0, all_units) if any(u -> u.initial_power > 0, all_units)
error( error("The initial power of all generators must be 0.")
"The initial power of all generators must be 0.",
)
end end
if any(u -> u.initial_status >= 0, all_units) if any(u -> u.initial_status >= 0, all_units)
error( error("The initial status of all generators must be negative.")
"The initial status of all generators must be negative.",
)
end end
# CHECK: model does not support startup costs (in time series) # CHECK: model does not support startup costs (in time series)
if any(u -> length(u.startup_categories) > 1, all_units) if any(u -> length(u.startup_categories) > 1, all_units)
error( error("The method does NOT support time-varying start-up costs.")
"The method does NOT support time-varying start-up costs.",
)
end end
end end
@ -204,7 +198,7 @@ function _modify_instance!(
first_startup_cost = 0.0 # zero out the start up cost first_startup_cost = 0.0 # zero out the start up cost
end end
unit.startup_categories = unit.startup_categories =
StartupCategory[StartupCategory(0, first_startup_cost)] StartupCategory[StartupCategory(0, first_startup_cost)]
end end
return instance.units_by_name = Dict(g.name => g for g in instance.units) return instance.units_by_name = Dict(g.name => g for g in instance.units)
end end

Loading…
Cancel
Save