Skip to content

Commit f79566f

Browse files
committed
apply in MOI.Parameter constraint instead of creating new variable
1 parent 9471088 commit f79566f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/ApplicationDrivenLearning.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,10 @@ and new constraint fixing to original forecast variables.
135135
function build_plan_model_forecast_params(model::Model)
136136
# adds parametrized forecast variables using MOI.Parameter
137137
forecast_size = size(model.forecast_vars)[1]
138-
model.plan_forecast_params = @variable(
139-
model.plan,
140-
_forecast[1:forecast_size] in MOI.Parameter.(zeros(forecast_size))
141-
)
142-
# fixes old and new prediction variables together
138+
model.plan_forecast_params = plan_forecast_vars(model)
143139
@constraint(
144140
model.plan,
145-
plan_forecast_fix,
146-
model.plan_forecast_params .== plan_forecast_vars(model)
141+
model.plan_forecast_params .∈ MOI.Parameter.(zeros(forecast_size))
147142
)
148143
end
149144

0 commit comments

Comments
 (0)