Skip to content

Commit 2667e0d

Browse files
committed
changed: omit noi used arguments
1 parent 91456c6 commit 2667e0d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/controller/transcription.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ for this transcription method.
5454
struct MultipleShooting <: TranscriptionMethod end
5555

5656
"Get the number of elements in the optimization decision vector `Z`."
57-
function get_nZ(estim::StateEstimator, transcription::SingleShooting, Hp, Hc)
57+
function get_nZ(estim::StateEstimator, ::SingleShooting, Hp, Hc)
5858
return estim.model.nu*Hc
5959
end
60-
function get_nZ(estim::StateEstimator, transcription::MultipleShooting, Hp, Hc)
60+
function get_nZ(estim::StateEstimator, ::MultipleShooting, Hp, Hc)
6161
return estim.model.nu*Hc + estim.nx̂*Hp
6262
end
6363

@@ -106,14 +106,14 @@ in which ``\mathbf{P_{Δu}}`` is defined in the Extended Help section.
106106
function init_ZtoΔU end
107107

108108
function init_ZtoΔU(
109-
estim::StateEstimator{NT}, transcription::SingleShooting, _ , Hc
109+
estim::StateEstimator{NT}, ::SingleShooting, _ , Hc
110110
) where {NT<:Real}
111111
PΔu = Matrix{NT}(I, estim.model.nu*Hc, estim.model.nu*Hc)
112112
return PΔu
113113
end
114114

115115
function init_ZtoΔU(
116-
estim::StateEstimator{NT}, transcription::MultipleShooting, Hp, Hc
116+
estim::StateEstimator{NT}, ::MultipleShooting, Hp, Hc
117117
) where {NT<:Real}
118118
I_nu_Hc = Matrix{NT}(I, estim.model.nu*Hc, estim.model.nu*Hc)
119119
PΔu = [I_nu_Hc zeros(NT, estim.model.nu*Hc, estim.nx̂*Hp)]
@@ -177,7 +177,7 @@ function init_ZtoU(
177177
end
178178

179179
init_PUmat( _ , transcription::SingleShooting, _ , _ , PUdagger) = PUdagger
180-
function init_PUmat(estim, transcription::MultipleShooting, Hp, _ , PUdagger)
180+
function init_PUmat(estim, ::MultipleShooting, Hp, _ , PUdagger)
181181
return [PUdagger zeros(eltype(PUdagger), estim.model.nu*Hp, estim.nx̂*Hp)]
182182
end
183183

@@ -372,7 +372,7 @@ They are defined in the Extended Help section.
372372
```
373373
"""
374374
function init_predmat(
375-
model::LinModel, estim::StateEstimator{NT}, transcription::MultipleShooting, Hp, Hc
375+
model::LinModel, estim::StateEstimator{NT}, ::MultipleShooting, Hp, Hc
376376
) where {NT<:Real}
377377
Ĉ, D̂d = estim.Ĉ, estim.D̂d
378378
nu, nx̂, ny, nd = model.nu, estim.nx̂, model.ny, model.nd
@@ -494,7 +494,7 @@ matrices ``\mathbf{E_ŝ, G_ŝ, J_ŝ, K_ŝ, V_ŝ, B_ŝ}`` are defined in th
494494
```
495495
"""
496496
function init_defectmat(
497-
model::LinModel, estim::StateEstimator{NT}, transcription::MultipleShooting, Hp, Hc
497+
model::LinModel, estim::StateEstimator{NT}, ::MultipleShooting, Hp, Hc
498498
) where {NT<:Real}
499499
nu, nx̂, nd = model.nu, estim.nx̂, model.nd
500500
Â, B̂u, B̂d = estim.Â, estim.B̂u, estim.B̂d
@@ -904,7 +904,7 @@ function linconstraint!(mpc::PredictiveController, model::LinModel, ::Transcript
904904
end
905905

906906
"Set `b` excluding predicted output constraints for `NonLinModel` and not `SingleShooting`."
907-
function linconstraint!(mpc::PredictiveController, model::NonLinModel, ::TranscriptionMethod)
907+
function linconstraint!(mpc::PredictiveController, ::NonLinModel, ::TranscriptionMethod)
908908
nU, nΔŨ, nY = length(mpc.con.U0min), length(mpc.con.ΔŨmin), length(mpc.con.Y0min)
909909
nx̂, fx̂ = mpc.estim.nx̂, mpc.con.fx̂
910910
# here, updating fx̂ is not necessary since fx̂ = 0
@@ -994,7 +994,7 @@ If supported by `mpc.optim`, it warm-starts the solver at:
994994
where ``\mathbf{Δu}(k+j|k-1)`` is the input increment for time ``k+j`` computed at the
995995
last control period ``k-1``, and ``ϵ(k-1)``, the slack variable of the last control period.
996996
"""
997-
function set_warmstart!(mpc::PredictiveController, transcription::SingleShooting, Z̃var)
997+
function set_warmstart!(mpc::PredictiveController, ::SingleShooting, Z̃var)
998998
nu, Hc, Z̃s = mpc.estim.model.nu, mpc.Hc, mpc.buffer.
999999
# --- input increments ΔU ---
10001000
Z̃s[1:(Hc*nu-nu)] .= @views mpc.Z̃[nu+1:Hc*nu]
@@ -1031,7 +1031,7 @@ where ``\mathbf{x̂_0}(k+j|k-1)`` is the predicted state for time ``k+j`` comput
10311031
last control period ``k-1``, expressed as a deviation from the operating point
10321032
``\mathbf{x̂_{op}}``.
10331033
"""
1034-
function set_warmstart!(mpc::PredictiveController, transcription::MultipleShooting, Z̃var)
1034+
function set_warmstart!(mpc::PredictiveController, ::MultipleShooting, Z̃var)
10351035
nu, nx̂, Hp, Hc, Z̃s = mpc.estim.model.nu, mpc.estim.nx̂, mpc.Hp, mpc.Hc, mpc.buffer.
10361036
# --- input increments ΔU ---
10371037
Z̃s[1:(Hc*nu-nu)] .= @views mpc.Z̃[nu+1:Hc*nu]
@@ -1045,7 +1045,7 @@ function set_warmstart!(mpc::PredictiveController, transcription::MultipleShooti
10451045
return Z̃s
10461046
end
10471047

1048-
getΔŨ!(ΔŨ, mpc::PredictiveController, ::SingleShooting, Z̃) = (ΔŨ .= Z̃)
1048+
getΔŨ!(ΔŨ, ::PredictiveController, ::SingleShooting, Z̃) = (ΔŨ .= Z̃)
10491049
function getΔŨ!(ΔŨ, mpc::PredictiveController, ::TranscriptionMethod, Z̃)
10501050
# avoid explicit matrix multiplication with mpc.P̃Δu for performance:
10511051
nΔU = mpc.Hc*mpc.estim.model.nu
@@ -1159,7 +1159,7 @@ The method mutates the `g` vectors in argument and returns it. Only the custom c
11591159
are include in the `g` vector.
11601160
"""
11611161
function con_nonlinprog!(
1162-
g, mpc::PredictiveController, ::LinModel, ::TranscriptionMethod, _ , _ , gc, ϵ
1162+
g, ::PredictiveController, ::LinModel, ::TranscriptionMethod, _ , _ , gc, ϵ
11631163
)
11641164
for i in eachindex(g)
11651165
g[i] = gc[i]

0 commit comments

Comments
 (0)