Skip to content

Commit 297314e

Browse files
committed
changed: cleanup in new nonlinear oracle code
1 parent ee15899 commit 297314e

File tree

3 files changed

+202
-182
lines changed

3 files changed

+202
-182
lines changed

src/controller/construct.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,11 +439,11 @@ function setconstraint!(
439439
JuMP.delete(optim, optim[:linconstraint])
440440
JuMP.unregister(optim, :linconstraint)
441441
@constraint(optim, linconstraint, A*Z̃var .≤ b)
442-
# TODO: change this !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
443442
if JuMP.solver_name(optim) "Ipopt"
444443
set_nonlincon!(mpc, model, transcription, optim)
445444
else
446-
set_nonlincon_exp(mpc, optim)
445+
g_oracle, geq_oracle = get_nonlinops(mpc, optim)
446+
set_nonlincon_exp!(mpc, transcription, g_oracle, geq_oracle)
447447
end
448448
else
449449
i_b, i_g = init_matconstraint_mpc(
@@ -458,6 +458,12 @@ function setconstraint!(
458458
return mpc
459459
end
460460

461+
"By default, no nonlinear operators, return 4 nothing"
462+
get_nonlinops(::PredictiveController, _ ) = (nothing, nothing, nothing, nothing)
463+
464+
"By default, no nonlinear constraints, return nothing."
465+
set_nonlincon_exp!(::PredictiveController, ::TranscriptionMethod, _ , _) = nothing
466+
461467
"""
462468
default_Hp(model::LinModel)
463469

0 commit comments

Comments
 (0)