Private functions

CTProblems.OCPDefType
struct 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)
source
CTProblems.OptimalControlProblemType
struct 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
source
Base.showMethod
show(
    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
source
Base.showMethod
show(
    io::IO,
    _::MIME{Symbol("text/plain")},
    problems::Tuple{Vararg{CTProblems.OptimalControlProblem}}
)

Print a tuple of optimal control problems.

source
Base.showMethod
show(io::IO, _::MIME{Symbol("text/plain")}, t::Tuple{})

Print an empty tuple.

source
Base.showerrorMethod
showerror(io::IO, e::CTProblems.NonExistingProblem)

Print the error message when the optimal control problem described by e.example does not exist.

source
CTProblems._keepMethod
_keep(
    description::Tuple{Vararg{Symbol}},
    e::Expr
) -> Union{Missing, Nothing, Bool}

Return if description is consistent with the expression e.

source
CTProblems._keepMethod
_keep(
    description::Tuple{Vararg{Symbol}},
    e::QuoteNode
) -> Union{Missing, Bool}

If e.value is a Symbol, then return e.value ∈ description.

source
CTProblems._keepMethod
_keep(
    description::Tuple{Vararg{Symbol}},
    s::Symbol,
    e::Expr
) -> Union{Missing, Bool}

If s is the Symbol "!", then return !_keep(description, e).

source
CTProblems._keepMethod
_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.

source