@@ -53,14 +53,13 @@ struct ControllerWeights{
53
53
iszero_E:: Bool
54
54
isinf_C :: Bool
55
55
function ControllerWeights {NT} (
56
- model, Hp, Hc, M_Hp:: MW , N_Hc:: NW , L_Hp:: LW , Cwt= Inf , Ewt= 0
56
+ M_Hp:: MW , N_Hc:: NW , L_Hp:: LW , Cwt, Ewt
57
57
) where {
58
58
NT<: Real ,
59
59
MW<: AbstractMatrix{NT} ,
60
60
NW<: AbstractMatrix{NT} ,
61
61
LW<: AbstractMatrix{NT}
62
62
}
63
- validate_weights (model, Hp, Hc, M_Hp, N_Hc, L_Hp, Cwt, Ewt)
64
63
nΔU = size (N_Hc, 1 )
65
64
C = Cwt
66
65
isinf_C = isinf (C)
@@ -87,11 +86,12 @@ struct ControllerWeights{
87
86
end
88
87
end
89
88
90
- " Outer constructor to convert weight matrix number type to `NT` if necessary."
89
+ " Outer constructor to validate and convert weight matrices if necessary."
91
90
function ControllerWeights (
92
91
model:: SimModel{NT} , Hp, Hc, M_Hp, N_Hc, L_Hp, Cwt= Inf , Ewt= 0
93
92
) where {NT<: Real }
94
- return ControllerWeights {NT} (model, Hp, Hc, NT .(M_Hp), NT .(N_Hc), NT .(L_Hp), Cwt, Ewt)
93
+ validate_weights (model, Hp, Hc, M_Hp, N_Hc, L_Hp, Cwt, Ewt)
94
+ return ControllerWeights {NT} (NT .(M_Hp), NT .(N_Hc), NT .(L_Hp), Cwt, Ewt)
95
95
end
96
96
97
97
" Include all the data for the constraints of [`PredictiveController`](@ref)"
0 commit comments