@@ -29,17 +29,23 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::OptimalControlModel{<: TimeD
29
29
@assert hasproperty (ocp. model_expression, :head )
30
30
31
31
#
32
- # println(io)
32
+ println (io)
33
+ printstyled (io, " The " , bold= true )
34
+ is_time_dependent (ocp) ? printstyled (io, " (non autonomous) " , bold= true ) : printstyled (io, " (autonomous) " , bold= true )
35
+ printstyled (io, " optimal control problem is given by:\n " , bold= true )
36
+ println (io)
33
37
34
38
# print the code
35
- tab = 0
39
+ tab = 4
36
40
code = striplines (ocp. model_expression)
37
41
@match code. head begin
38
42
:block => [__print (code. args[i], io, tab) for i ∈ eachindex (code. args)]
39
43
_ => __print (code, io, tab)
40
44
end
41
-
42
- elseif __is_complete (ocp) # print the model if is is complete
45
+
46
+ end
47
+
48
+ if __is_complete (ocp) # print the model if is is complete
43
49
44
50
# dimensions
45
51
x_dim = ocp. state_dimension
@@ -68,8 +74,11 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::OptimalControlModel{<: TimeD
68
74
control_args_names = t_ * u_name * " (" * t_name * " )" * _v
69
75
70
76
#
71
- printstyled (io, " Optimal control problem of the form:\n " )
72
- println (io, " " )
77
+ println (io)
78
+ printstyled (io, " The " , bold= true )
79
+ is_time_dependent (ocp) ? printstyled (io, " (non autonomous) " , bold= true ) : printstyled (io, " (autonomous) " , bold= true )
80
+ printstyled (io, " optimal control problem is of the form:\n " , bold= true )
81
+ println (io)
73
82
74
83
# J
75
84
printstyled (io, " minimize " , color= :blue ); print (io, " J(" * x_name * " , " * u_name * _v * " ) = " )
@@ -178,14 +187,22 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::OptimalControlModel{<: TimeD
178
187
179
188
end
180
189
190
+ #
191
+ println (io)
192
+ printstyled (io, " Declarations " , bold= true )
193
+ printstyled (io, " (* required):\n " , bold= false )
194
+ # println(io)
195
+
181
196
# print table of settings
182
- header = [ " times" , " state" , " control" ]
183
- is_variable_dependent (ocp) && push! (header, " variable" )
184
- push! (header, " dynamics" , " objective" , " constraints" )
197
+ header = [ " times*" , " state*" , " control*" ]
198
+ # is_variable_dependent(ocp) && push!(header, "variable")
199
+ push! (header, " variable" )
200
+ push! (header, " dynamics*" , " objective*" , " constraints" )
185
201
data = hcat (__is_time_not_set (ocp) ? " ❌" : " ✅" ,
186
202
__is_state_not_set (ocp) ? " ❌" : " ✅" ,
187
203
__is_control_not_set (ocp) ? " ❌" : " ✅" )
188
- is_variable_dependent (ocp) && begin
204
+ # is_variable_dependent(ocp) &&
205
+ begin
189
206
(data = hcat (data,
190
207
__is_variable_not_set (ocp) ? " ❌" : " ✅" ))
191
208
end
0 commit comments