-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from JuliaReach/mforets/algos_input
Update algorithms for reachability with inputs
- Loading branch information
Showing
13 changed files
with
336 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# case with input and without invariant | ||
function reach_homog_ASB07!(F::Vector{ReachSet{N, Zonotope{N, VN, MN}}}, | ||
Ω0::Zonotope{N, VN, MN}, | ||
Φ::AbstractMatrix, | ||
NSTEPS::Integer, | ||
δ::N, | ||
max_order::Integer, | ||
X::Universe, | ||
U::Zonotope, | ||
recursive::Val{true}, | ||
reduction_method::AbstractReductionMethod) where {N, VN, MN} | ||
# initial reach set | ||
Δt = zero(N) .. δ | ||
@inbounds F[1] = ReachSet(Ω0, Δt) | ||
|
||
# input sequence | ||
Wk₊ = copy(U) | ||
|
||
# split the interval matrix into center and radius | ||
Φc, Φs = _split(Φ) | ||
|
||
k = 2 | ||
@inbounds while k <= NSTEPS | ||
Zₖ₋₁ = set(F[k-1]) | ||
cₖ₋₁ = Zₖ₋₁.center | ||
Gₖ₋₁ = Zₖ₋₁.generators | ||
|
||
Zₖ = _overapproximate_interval_linear_map(Φc, Φs, cₖ₋₁, Gₖ₋₁) | ||
Zₖ = _minkowski_sum(Wk₊, Zₖ) | ||
Zₖʳ = _reduce_order(Zₖ, max_order, reduction_method) | ||
|
||
k += 1 | ||
Δt += δ | ||
F[k] = ReachSet(Zₖʳ, Δt) | ||
|
||
Wk₊ = _overapproximate_interval_linear_map(Φc, Φs, Wk₊.center, Wk₊.generators) | ||
Wk₊ = _reduce_order(Wk₊, max_order, reduction_method) | ||
end | ||
return F | ||
end | ||
|
||
# case with input and with invariant | ||
function reach_homog_ASB07!(F::Vector{ReachSet{N, Zonotope{N, VN, MN}}}, | ||
Ω0::Zonotope{N, VN, MN}, | ||
Φ::AbstractMatrix, | ||
NSTEPS::Integer, | ||
δ::N, | ||
max_order::Integer, | ||
X::LazySet, | ||
U::Zonotope, | ||
recursive::Val{true}, | ||
reduction_method::AbstractReductionMethod) where {N, VN, MN} | ||
# initial reach set | ||
Δt = zero(N) .. δ | ||
@inbounds F[1] = ReachSet(Ω0, Δt) | ||
|
||
# input sequence | ||
Wk₊ = copy(U) | ||
|
||
# split the interval matrix into center and radius | ||
Φc, Φs = _split(Φ) | ||
|
||
k = 2 | ||
@inbounds while k <= NSTEPS | ||
Zₖ₋₁ = set(F[k-1]) | ||
cₖ₋₁ = Zₖ₋₁.center | ||
Gₖ₋₁ = Zₖ₋₁.generators | ||
|
||
Zₖ = _overapproximate_interval_linear_map(Φc, Φs, cₖ₋₁, Gₖ₋₁) | ||
Zₖ = _minkowski_sum(Wk₊, Zₖ) | ||
Zₖʳ = _reduce_order(Zₖ, max_order, reduction_method) | ||
_is_intersection_empty(X, Zₖʳ) && break | ||
|
||
k += 1 | ||
Δt += δ | ||
F[k] = ReachSet(Zₖʳ, Δt) | ||
|
||
Wk₊ = _overapproximate_interval_linear_map(Φc, Φs, Wk₊.center, Wk₊.generators) | ||
Wk₊ = _reduce_order(Wk₊, max_order, reduction_method) | ||
end | ||
if k < NSTEPS + 1 | ||
resize!(F, k-1) | ||
end | ||
return F | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.