Skip to content

Commit 2730e8b

Browse files
authored
Merge pull request #289 from JuliaControl/bench_getinfo
bench: added `getinfo` function in unit tests
2 parents 06ee06e + e7beb74 commit 2730e8b

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

benchmark/2_bench_state_estim.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ UNIT_ESTIM["MovingHorizonEstimator"]["updatestate!"]["LinModel"]["Prediction for
172172
setup=preparestate!($mhe_lin_pred, $y, $d),
173173
samples=samples, evals=evals, seconds=seconds,
174174
)
175+
UNIT_ESTIM["MovingHorizonEstimator"]["getinfo!"]["LinModel"] =
176+
@benchmarkable(
177+
getinfo($mhe_lin_curr),
178+
setup=preparestate!($mhe_lin_curr, $y, $d),
179+
samples=samples, evals=evals, seconds=seconds,
180+
)
175181
UNIT_ESTIM["MovingHorizonEstimator"]["preparestate!"]["NonLinModel"]["Current form"] =
176182
@benchmarkable(
177183
preparestate!($mhe_nonlin_curr, $y, $d),
@@ -193,7 +199,13 @@ UNIT_ESTIM["MovingHorizonEstimator"]["updatestate!"]["NonLinModel"]["Prediction
193199
updatestate!($mhe_nonlin_pred, $u, $y, $d),
194200
setup=preparestate!($mhe_nonlin_pred, $y, $d),
195201
samples=samples, evals=evals, seconds=seconds,
196-
)
202+
)
203+
UNIT_ESTIM["MovingHorizonEstimator"]["getinfo!"]["NonLinModel"] =
204+
@benchmarkable(
205+
getinfo($mhe_nonlin_curr),
206+
setup=preparestate!($mhe_nonlin_curr, $y, $d),
207+
samples=samples, evals=evals, seconds=seconds,
208+
)
197209

198210
## ----------------------------------------------------------------------------------------
199211
## ----------------- CASE STUDIES ---------------------------------------------------------

benchmark/3_bench_predictive_control.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ UNIT_MPC["LinMPC"]["moveinput!"]["MultipleShooting"] =
2525
setup=preparestate!($linmpc_ms, $y, $d),
2626
samples=samples, evals=evals, seconds=seconds
2727
)
28+
UNIT_MPC["LinMPC"]["getinfo!"] =
29+
@benchmarkable(
30+
getinfo($linmpc_ss),
31+
setup=(preparestate!($linmpc_ss, $y, $d); moveinput!($linmpc_ss, $y, $d)),
32+
samples=samples, evals=evals, seconds=seconds
33+
)
2834

2935
empc = ExplicitMPC(linmodel, Mwt=[1, 1], Nwt=[0.1, 0.1], Lwt=[0.1, 0.1], Hp=10)
3036

@@ -76,6 +82,12 @@ UNIT_MPC["NonLinMPC"]["moveinput!"]["LinModel"]["MultipleShooting"] =
7682
setup=preparestate!($nmpc_lin_ms, $y, $d),
7783
samples=samples, evals=evals, seconds=seconds
7884
)
85+
UNIT_MPC["NonLinMPC"]["getinfo!"]["LinModel"] =
86+
@benchmarkable(
87+
getinfo($nmpc_lin_ss),
88+
setup=(preparestate!($nmpc_lin_ss, $y, $d); moveinput!($nmpc_lin_ss, $y, $d)),
89+
samples=samples, evals=evals, seconds=seconds
90+
)
7991
UNIT_MPC["NonLinMPC"]["moveinput!"]["NonLinModel"]["SingleShooting"] =
8092
@benchmarkable(
8193
moveinput!($nmpc_nonlin_ss, $y, $d),
@@ -106,6 +118,12 @@ UNIT_MPC["NonLinMPC"]["moveinput!"]["NonLinModel"]["TrapezoidalCollocation"] =
106118
setup=preparestate!($nmpc_nonlin_tc, $y_c, $d_c),
107119
samples=samples, evals=evals, seconds=seconds
108120
)
121+
UNIT_MPC["NonLinMPC"]["getinfo!"]["NonLinModel"] =
122+
@benchmarkable(
123+
getinfo($nmpc_nonlin_ss),
124+
setup=(preparestate!($nmpc_nonlin_ss, $y, $d); moveinput!($nmpc_nonlin_ss, $y, $d)),
125+
samples=samples, evals=evals, seconds=seconds
126+
)
109127

110128
## ----------------------------------------------------------------------------------------
111129
## ---------------------- CASE STUDIES ----------------------------------------------------

0 commit comments

Comments
 (0)