Skip to content

Commit

Permalink
let intersection of reach sets create a reach set
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jan 8, 2025
1 parent 92b5729 commit 6538da6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ReachSets/AbstractReachSet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,15 @@ end

function intersection(R::AbstractReachSet, S::AbstractReachSet,
method::AbstractIntersectionMethod=FallbackIntersection())
return _intersection(set(R), set(S), method)
T1 = tspan(R)
T2 = tspan(S)
T = T1 T2
if isempty(T)
throw(ArgumentError("cannot intersect reach sets with disjoint time intervals"))
end

cap = _intersection(set(R), set(S), method)
return ReachSet(cap, T)
end

# fallback methods for reach-sets
Expand Down

0 comments on commit 6538da6

Please sign in to comment.