Skip to content

Commit feac63a

Browse files
committed
update get_continuous_events to only apply to systems that have them
1 parent 022af77 commit feac63a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/systems/callbacks.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#################################### system operations #####################################
2-
get_continuous_events(sys::AbstractSystem) = SymbolicContinuousCallback[]
3-
get_continuous_events(sys::AbstractTimeDependentSystem) = getfield(sys, :continuous_events)
42
has_continuous_events(sys::AbstractSystem) = isdefined(sys, :continuous_events)
3+
function get_continuous_events(sys::AbstractSystem)
4+
has_continuous_events(sys) || return SymbolicContinuousCallback[]
5+
getfield(sys, :discrete_events)
6+
end
57

68
has_discrete_events(sys::AbstractSystem) = isdefined(sys, :discrete_events)
79
function get_discrete_events(sys::AbstractSystem)

0 commit comments

Comments
 (0)