Skip to content

Commit a93a568

Browse files
authored
Merge pull request #271 from JuliaControl/test_legacy
test: adding trivial tests with `oracle=false`
2 parents 92eec87 + c5c824d commit a93a568

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/3_test_predictive_control.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,8 +1035,19 @@ end
10351035
([0.21,0.22,0.23,0.24,0.25,0.26], [0.31,0.32,0.33,0.34,0.35,0.36]))
10361036

10371037
# TODO: delete these tests when the deprecated legacy splatting syntax will be.
1038-
nmpc_lin_leg = NonLinMPC(linmodel1, Hp=1, Hc=1, oracle=false)
1039-
nmpc_ms_leg = NonLinMPC(nonlinmodel, Hp=1, Hc=1, oracle=false, transcription=MultipleShooting())
1038+
gc_leg! = (LHS,_,_,_,_,_) -> (LHS[begin] = -1)
1039+
nc_leg = 1
1040+
nmpc_lin_leg = setconstraint!(
1041+
NonLinMPC(linmodel1, Hp=1, Hc=1, gc=gc_leg!, nc=nc_leg, oracle=false),
1042+
ymin=[-1e3, -1e3], ymax=[1e3,1e3]
1043+
)
1044+
nmpc_ms_leg = setconstraint!(
1045+
NonLinMPC(
1046+
nonlinmodel, Hp=1, Hc=1, gc=gc_leg!, nc=nc_leg,
1047+
oracle=false, transcription=MultipleShooting()
1048+
),
1049+
ymin=[-1e3, -1e3], ymax=[1e3,1e3]
1050+
)
10401051
nmpc_leg = NonLinMPC(nonlinmodel, Hp=1, Hc=1, oracle=false)
10411052

10421053
setconstraint!(nmpc_leg, umin=[-5, -9.9], umax=[100,99])

0 commit comments

Comments
 (0)