Skip to content

Commit 47a257e

Browse files
committed
start on discrete callbacks
1 parent b696d4b commit 47a257e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/systems/callbacks.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ get_continuous_events(sys::AbstractSystem) = Equation[]
33
get_continuous_events(sys::AbstractODESystem) = getfield(sys, :continuous_events)
44
has_continuous_events(sys::AbstractSystem) = isdefined(sys, :continuous_events)
55

6+
has_discrete_events(sys::AbstractSystem) = isdefined(sys, :discrete_events)
7+
function get_discrete_events(sys::AbstractSystem)
8+
has_discrete_events(sys) ||
9+
error("Systems of type $(typeof(sys)) do not support discrete events.")
10+
getfield(sys, :discrete_events)
11+
end
12+
613
#################################### continuous events #####################################
714

815
const NULL_AFFECT = Equation[]

0 commit comments

Comments
 (0)