You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/callbacks.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,18 @@ refer to the [Cascading Failure](@ref) example.
16
16
In practice, events often act locally, meaning they only depend and act on a
17
17
specific component or type of component. `NetworkDynamics.jl` provides a way of
18
18
defining those callbacks on a component level and automaticially combine them into performant
19
-
[`VectorContinuousCallback`](@extref SciMLBase.VectorContinuousCallback) for the whole network.
19
+
[`VectorContinuousCallback`](@extref SciMLBase.VectorContinuousCallback) and [`DiscreteCallback`](@extref SciMLBase.DiscreteCallback) for the whole network.
20
20
21
-
The main entry points are the types [`ContinousComponentCallback`](@ref) and
22
-
[`VectorContinousComponentCallback`](@ref). Both of those objects combine a [`ComponentCondition`](@ref)
23
-
with an [`ComponentAffect`](@ref).
24
-
The "normal" `ContinousComponentCallback` has a condition which returns a single value. The corresponding affect is triggered when the return value hits zero.
21
+
The main entry points are the types [`ContinousComponentCallback`](@ref),
22
+
[`VectorContinousComponentCallback`](@ref) and [`DiscreteComponentCallback`](@ref). All of those objects combine a [`ComponentCondition`](@ref) with an [`ComponentAffect`](@ref).
23
+
24
+
The "normal" [`ContinousComponentCallback`](@ref) and [`DiscreteComponentCallback`](@ref) have a condition which returns a single value. The corresponding affect is triggered when the return value hits zero.
25
25
In contrast, the "vector" version has an in-place condition which writes `len` outputs. When any of those outputs hits zero, the affect is triggered with an additional argument `event_idx` which tells the effect which dimension encountered the zerocrossing.
26
26
27
+
There is a special type [`PresetTimeComponentCallback`](@ref) which has no explicit condition and triggers the affect at given times.
28
+
This internally generates a [`PresetTimeCallback`](@ref DiffEqCallbacks.PresetTimeCallback) object from `DiffEqCallbacks.jl`.
29
+
30
+
27
31
### Defining the Callback
28
32
To construct a condition function, you need to tell network dynamics which states and parameters you'd like to "observe" within the condition. Within the actual condition, those states will be made available:
0 commit comments