@@ -123,21 +123,18 @@ callbacks are collected for the whole network using `get_callbacks`.
123123[`DiffEq.jl docs`](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/)
124124for available options.
125125"""
126- struct ContinuousComponentCallback{C,CDIM,CPDIM,A,ADIM,APDIM,An,AnDIM,AnPDIM} <: ComponentCallback
127- condition:: ComponentCondition{C,CDIM,CPDIM}
128- affect:: ComponentAffect{A,ADIM,APDIM}
129- affect_neg:: Union{Nothing,ComponentAffect{An,AnDIM,AnPDIM}}
126+ struct ContinuousComponentCallback{
127+ C <: ComponentCondition ,
128+ A <: ComponentAffect ,
129+ An <: Union{ComponentAffect,Nothing}
130+ } <: ComponentCallback
131+ condition:: C
132+ affect:: A
133+ affect_neg:: An
130134 kwargs:: NamedTuple
131135end
132136function ContinuousComponentCallback (condition, affect; affect_neg! = affect, kwargs... )
133- if affect_neg! == nothing
134- ContinuousComponentCallback {_get_type_parameters(condition,affect)...,Nothing,Nothing,Nothing} (condition, affect, nothing , NamedTuple (kwargs))
135- else
136- ContinuousComponentCallback (condition, affect, affect_neg!, NamedTuple (kwargs))
137- end
138- end
139- function _get_type_parameters (condition:: ComponentCondition{C,CDIM,CPDIM} , affect:: ComponentAffect{A,ADIM,APDIM} ) where {C,CDIM,CPDIM,A,ADIM,APDIM}
140- C, CDIM, CPDIM, A, ADIM, APDIM
137+ ContinuousComponentCallback (condition, affect, affect_neg!, NamedTuple (kwargs))
141138end
142139
143140"""
@@ -158,19 +155,19 @@ callbacks are collected for the whole network using [`get_callbacks(::Network)`]
158155[`DiffEq.jl docs`](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/)
159156for available options.
160157"""
161- struct VectorContinuousComponentCallback{C,CDIM,CPDIM,A,ADIM,APDIM,An,AnDIM,AnPDIM} <: ComponentCallback
162- condition:: ComponentCondition{C,CDIM,CPDIM}
163- affect:: ComponentAffect{A,ADIM,APDIM}
164- affect_neg:: Union{Nothing,ComponentAffect{An,AnDIM,AnPDIM}}
158+ struct VectorContinuousComponentCallback{
159+ C <: ComponentCondition ,
160+ A <: ComponentAffect ,
161+ An <: Union{ComponentAffect,Nothing}
162+ } <: ComponentCallback
163+ condition:: C
164+ affect:: A
165+ affect_neg:: An
165166 len:: Int
166167 kwargs:: NamedTuple
167168end
168169function VectorContinuousComponentCallback (condition, affect, len; affect_neg! = affect, kwargs... )
169- if affect_neg! == nothing
170- VectorContinuousComponentCallback {_get_type_parameters(condition,affect)...,Nothing,Nothing,Nothing} (condition, affect, nothing , len, NamedTuple (kwargs))
171- else
172- VectorContinuousComponentCallback (condition, affect, affect_neg!, len, NamedTuple (kwargs))
173- end
170+ VectorContinuousComponentCallback (condition, affect, affect_neg!, len, NamedTuple (kwargs))
174171end
175172
176173"""
0 commit comments