diff --git a/src/Flowpipes/Flowpipe.jl b/src/Flowpipes/Flowpipe.jl index e33559111..2ba25a47b 100644 --- a/src/Flowpipes/Flowpipe.jl +++ b/src/Flowpipes/Flowpipe.jl @@ -256,11 +256,6 @@ function ∈(x::AbstractVector{N}, fp::Flowpipe{N,<:AbstractLazyReachSet{N}}) wh return any(R -> x ∈ set(R), array(fp)) end -function ∈(x::AbstractVector{N}, - fp::VT) where {N,RT<:AbstractLazyReachSet{N},VT<:AbstractVector{RT}} - return any(R -> x ∈ set(R), fp) -end - function LazySets.linear_map(M, fp::Flowpipe) out = [linear_map(M, R) for R in fp] return Flowpipe(out, fp.ext) diff --git a/src/Flowpipes/clustering.jl b/src/Flowpipes/clustering.jl index 89a32fe65..a71b83f23 100644 --- a/src/Flowpipes/clustering.jl +++ b/src/Flowpipes/clustering.jl @@ -125,15 +125,25 @@ end # for Taylor model flowpipes we preprocess it with a zonotopic overapproximation function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx, method::LazyClustering{P,Val{true}}) where {N,P} - Fz = overapproximate(Flowpipe(view(F, idx)), Zonotope) - return cluster(Fz, 1:length(idx), method) # Fx is now indexed from 1 ... length(idx) + return _cluster_TM(F, idx, method) +end +# disambiguations +function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx, + method::LazyClustering{Missing,Val{true}}) where {N} + return _cluster_TM(F, idx, method) end - -# ambiguity fix function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx, method::LazyClustering{P,Val{false}}) where {N,P} + return _cluster_TM(F, idx, method) +end +function cluster(F::Flowpipe{N,TaylorModelReachSet{N}}, idx, + method::LazyClustering{Missing,Val{false}}) where {N} + return _cluster_TM(F, idx, method) +end + +function _cluster_TM(F, idx, method) Fz = overapproximate(Flowpipe(view(F, idx)), Zonotope) - return cluster(Fz, 1:length(idx), method) + return cluster(Fz, 1:length(idx), method) # Fx is now indexed from 1 ... length(idx) end # ===================================== diff --git a/test/Aqua.jl b/test/Aqua.jl index 77c989389..f34142284 100644 --- a/test/Aqua.jl +++ b/test/Aqua.jl @@ -8,6 +8,5 @@ import Aqua piracies=(broken=true,)) # do not warn about ambiguities in dependencies - # the ambiguities should be resolved in the future - Aqua.test_ambiguities(ReachabilityAnalysis; broken=true) + Aqua.test_ambiguities(ReachabilityAnalysis) end diff --git a/test/flowpipes/flowpipes.jl b/test/flowpipes/flowpipes.jl index 3c6a54223..c49d3a98e 100644 --- a/test/flowpipes/flowpipes.jl +++ b/test/flowpipes/flowpipes.jl @@ -103,8 +103,8 @@ end times = 0:0.01:1.9 values = [[x] for x in (@. 1 - exp(-times))] - @test all(vi ∈ H(ti) for (ti, vi) in zip(times, values)) - @test all(vi ∈ H′(ti) for (ti, vi) in zip(times, values)) + @test all(any(vi ∈ R for R in H(ti)) for (ti, vi) in zip(times, values)) + @test all(any(vi ∈ R for R in H′(ti)) for (ti, vi) in zip(times, values)) end @testset "Flowpipe clustering" begin