Private functions
CTProblems.AbstractCTProblem
— Typeabstract type AbstractCTProblem
CTProblems.CTProblemsException
— Typeabstract type CTProblemsException <: Exception
CTProblems.NonExistingProblem
— Typestruct NonExistingProblem <: CTProblems.CTProblemsException
Fields
example::Tuple{Vararg{Symbol}}
CTProblems.OCPDef
— Typestruct OCPDef{description}
A type used to define new problems with a default constructor that throws a NonExistingProblem
exception if there is no optimal control problem described by example
.
Example
julia> CTProblems.OCPDef{(:ocp, :dummy)}()
ERROR: there is no optimal control problem described by (:ocp, :dummy)
CTProblems.OptimalControlProblem
— Typestruct OptimalControlProblem <: CTProblems.AbstractCTProblem
Fields
title::String
model::OptimalControlModel
solution::OptimalControlSolution
Example
julia> using CTProblems
julia> using CTBase
julia> title = "My empty optimal control problem"
julia> ocp = Model()
julia> sol = OptimalControlSolution()
julia> prob = CTProblems.OptimalControlProblem(title, ocp, sol)
julia> prob isa CTProblems.AbstractCTProblem
true
julia> prob isa CTProblems.OptimalControlProblem
true
Base.show
— Methodshow(
io::IO,
_::MIME{Symbol("text/plain")},
problem::CTProblems.OptimalControlProblem
)
Show the title and the types of the model and the solution of the optimal control problem.
julia> Problem(:integrator, :energy, :x_dim_2, :u_dim_1)
title = Double integrator - energy min
model (Type) = CTBase.OptimalControlModel{:autonomous, :scalar}
solution (Type) = CTBase.OptimalControlSolution
Base.show
— Methodshow(
io::IO,
_::MIME{Symbol("text/plain")},
problems::Tuple{Vararg{CTProblems.OptimalControlProblem}}
)
Print a tuple of optimal control problems.
Base.show
— Methodshow(io::IO, _::MIME{Symbol("text/plain")}, t::Tuple{})
Print an empty tuple.
Base.showerror
— Methodshowerror(io::IO, e::CTProblems.NonExistingProblem)
Print the error message when the optimal control problem described by e.example
does not exist.
CTProblems._keep
— Method_keep(
description::Tuple{Vararg{Symbol}},
e::Expr
) -> Union{Missing, Nothing, Bool}
Return if description
is consistent with the expression e
.
CTProblems._keep
— Method_keep(
description::Tuple{Vararg{Symbol}},
e::QuoteNode
) -> Union{Missing, Bool}
If e.value
is a Symbol, then return e.value ∈ description
.
CTProblems._keep
— Method_keep(
description::Tuple{Vararg{Symbol}},
s::Symbol,
e::Expr
) -> Union{Missing, Bool}
If s is the Symbol "!", then return !_keep(description, e)
.
CTProblems._keep
— Method_keep(
description::Tuple{Vararg{Symbol}},
s::Symbol,
e::QuoteNode
) -> Union{Missing, Bool}
If e.value
is a Symbol and if s is the Symbol "!", then return e.value ∉ description
.
CTProblems._problems_without_dummy
— Method_problems_without_dummy() -> Tuple
Return the list of optimal control problems (without the dummy problem).