@@ -700,14 +700,66 @@ $(TYPEDSIGNATURES)
700700Prints the solution.
701701"""
702702function Base. show (io:: IO , :: MIME"text/plain" , sol:: Solution )
703- return print (io, " Optimal Control Solution" )
704- end
703+ println (io, " Optimal Control Solution" )
704+ println (io, " ────────────────────────" )
705+
706+ # Status
707+ println (io, " • Success : " , success (sol))
708+ println (io, " • Stopping : " , stopping (sol))
709+ println (io, " • Message : " , message (sol))
710+ println (io, " • Iterations : " , iterations (sol))
711+ println (io, " • Objective : " , objective (sol))
712+ println (io, " • Constraint violation: " , constraints_violation (sol))
713+
714+ println (io)
715+ println (io, " Time" )
716+ println (io, " ────" )
717+ println (io, " • Name : " , time_name (sol))
718+ println (io, " • Grid : " , time_grid (sol))
719+ println (io, " • Grid length : " , length (time_grid (sol)))
720+
721+ println (io)
722+ println (io, " State" )
723+ println (io, " ─────" )
724+ println (io, " • Name : " , state_name (sol))
725+ println (io, " • Dimension : " , state_dimension (sol))
726+ println (io, " • Components : " , join (state_components (sol), " , " ))
727+
728+ println (io)
729+ println (io, " Control" )
730+ println (io, " ───────" )
731+ println (io, " • Name : " , control_name (sol))
732+ println (io, " • Dimension : " , control_dimension (sol))
733+ println (io, " • Components : " , join (control_components (sol), " , " ))
734+
735+ # Variable block (optional)
736+ v_dim = variable_dimension (sol)
737+ if v_dim > 0
738+ println (io)
739+ println (io, " Variable" )
740+ println (io, " ────────" )
741+ println (io, " • Name : " , variable_name (sol))
742+ println (io, " • Dimension : " , v_dim)
743+ println (io, " • Components : " , join (variable_components (sol), " , " ))
744+ println (io, " • Value : " , variable (sol))
745+ end
705746
706- """
707- $(TYPEDSIGNATURES)
747+ println (io)
748+ println (io, " Duals" )
749+ println (io, " ─────" )
750+ println (io, " • Boundary constraints dual : " , boundary_constraints_dual (sol))
751+ if v_dim > 0
752+ println (io, " • Variable constraints dual (lb): " , variable_constraints_lb_dual (sol))
753+ println (io, " • Variable constraints dual (ub): " , variable_constraints_ub_dual (sol))
754+ end
708755
709- """
710- function Base. show_default (io:: IO , sol:: Solution )
711- return print (io, " Optimal Control Solution" )
712- # show(io, MIME("text/plain"), sol)
713756end
757+
758+ # """
759+ # $(TYPEDSIGNATURES)
760+
761+ # """
762+ # function Base.show_default(io::IO, sol::Solution)
763+ # return print(io, "Optimal Control Solution")
764+ # #show(io, MIME("text/plain"), sol)
765+ # end
0 commit comments