diff --git a/src/Algorithms/A20/A20.jl b/src/Algorithms/A20/A20.jl index a01c49e57c..0127c67585 100644 --- a/src/Algorithms/A20/A20.jl +++ b/src/Algorithms/A20/A20.jl @@ -8,21 +8,24 @@ inputs in the Krylov subspace from [Althoff20](@citet). ### Fields -- `δ` -- step-size of the discretization -- `max_order` -- (optional, default: `5`) maximum zonotope order +- `δ` -- step-size of the discretization +- `approx_model` -- (optional, default: `FirstOrderZonotope()`) approximation model +- `max_order` -- (optional, default: `5`) maximum zonotope order ### References See [Althoff20](@citet) and references therein. """ -struct A20{N} <: AbstractContinuousPost +struct A20{N,AM} <: AbstractContinuousPost δ::N + approx_model::AM max_order::Int end # convenience constructor using keywords -function A20(; δ::N, max_order::Int=5) where {N} - return A20(δ, max_order) +# TODO change `FirstOrderZonotope` default +function A20(; δ::N, approx_model::AM=FirstOrderZonotope(), max_order::Int=5) where {N,AM} + return A20(δ, approx_model, max_order) end step_size(alg::A20) = alg.δ diff --git a/src/Algorithms/A20/post.jl b/src/Algorithms/A20/post.jl index 73823339fc..660dbfc414 100644 --- a/src/Algorithms/A20/post.jl +++ b/src/Algorithms/A20/post.jl @@ -3,7 +3,14 @@ # discrete post function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing; Δt0::TimeInterval=zeroI, kwargs...) where {N} - @unpack δ, max_order = alg + @unpack δ, approx_model, max_order = alg + # TODO define these options in the algorithm struct + static = Val(get(kwargs, :static, false)) + reduction_method = LazySets.GIR05() + dim = missing + ngens = missing + preallocate = Val(get(kwargs, :preallocate, true)) + disjointness_method = NoEnclosure() if isnothing(NSTEPS) if haskey(kwargs, :NSTEPS) @@ -25,7 +32,6 @@ function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing; Ω0 = reduce_order(Ω0, max_order, reduction_method) # reconvert the set of initial states and state matrix, if needed - static = get(kwargs, :static, false) Ω0 = _reconvert(Ω0, static, dim, ngens) Φ = _reconvert(Φ, static, dim) @@ -34,6 +40,7 @@ function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing; ZT = typeof(Ω0) F = Vector{ReachSet{N,ZT}}(undef, NSTEPS) + # TODO currently uses GLGM06 algorithm if got_homogeneous #= @@ -46,8 +53,7 @@ function post(alg::A20{N}, ivp::IVP{<:AbstractDiscreteSystem}, NSTEPS=nothing; end =# - reach_homog_GLGM06!(F, Ω0, Φ, NSTEPS, δ, max_order, X, preallocate, Δt0, - disjointness_method) + reach_homog_GLGM06!(F, Ω0, Φ, NSTEPS, δ, X, preallocate, Δt0, disjointness_method) else # TODO: implement preallocate option for this scenario U = inputset(ivp) diff --git a/src/ReachSets/TaylorModelReachSet.jl b/src/ReachSets/TaylorModelReachSet.jl index 9f28ed2df7..68a52e5132 100644 --- a/src/ReachSets/TaylorModelReachSet.jl +++ b/src/ReachSets/TaylorModelReachSet.jl @@ -2,7 +2,7 @@ # Taylor model reach set # ================================================================ -import ..Overapproximate: _overapproximate, _overapproximate_hparallelotope +import .Overapproximate: _overapproximate, _overapproximate_hparallelotope """ TaylorModelReachSet{N, S} <: AbstractTaylorModelReachSet{N}