Skip to content

Commit

Permalink
formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Dec 26, 2024
1 parent 88f77f4 commit c6e980a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/add_parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ function PSI._update_parameter_values!(
# sim_timestamps = range(current_time; step=model_resolution, length=final_time)
for name in component_names
state_value = 0.0
timestamp_range = state_data_index:min(max_state_index, state_data_index + final_time - 1)
timestamp_range =
state_data_index:min(max_state_index, state_data_index + final_time - 1)
for t in timestamp_range
#=
@debug "parameter horizon is over the step" max_state_index > state_data_index + 1
Expand Down Expand Up @@ -543,7 +544,8 @@ function PSI._add_parameters!(
else
key = PSI.AuxVarKey{CyclingChargeUsage, PSY.HybridSystem}("")
end
parameter_container = PSI.add_param_container!(container, T(), D, key, names, [time_steps[end]])
parameter_container =
PSI.add_param_container!(container, T(), D, key, names, [time_steps[end]])
jump_model = PSI.get_jump_model(container)

for d in devices
Expand All @@ -554,7 +556,7 @@ function PSI._add_parameters!(
jump_model,
mult * PSI.get_initial_parameter_value(T(), d, W()),
name,
time_steps[end]
time_steps[end],
)
end
return
Expand Down
10 changes: 8 additions & 2 deletions src/feedforwards.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ function PSI.add_feedforward_constraints!(
cycles_per_day * fraction_of_hour * length(time_steps) / HOURS_IN_DAY
if PSI.built_for_recurrent_solves(container)
param_value =
PSI.get_parameter_array(container, CyclingChargeLimitParameter(), D)[ci_name, time_steps[end]]
PSI.get_parameter_array(container, CyclingChargeLimitParameter(), D)[
ci_name,
time_steps[end],
]
con_cycling_ch[ci_name] = JuMP.@constraint(
PSI.get_jump_model(container),
efficiency.in *
Expand Down Expand Up @@ -249,7 +252,10 @@ function PSI.add_feedforward_constraints!(
cycles_per_day * fraction_of_hour * length(time_steps) / HOURS_IN_DAY
if PSI.built_for_recurrent_solves(container)
param_value =
PSI.get_parameter_array(container, CyclingDischargeLimitParameter(), D)[ci_name, time_steps[end]]
PSI.get_parameter_array(container, CyclingDischargeLimitParameter(), D)[
ci_name,
time_steps[end],
]
con_cycling_ds[ci_name] = JuMP.@constraint(
PSI.get_jump_model(container),
(1.0 / efficiency.out) *
Expand Down

0 comments on commit c6e980a

Please sign in to comment.