Skip to content

Commit 018ccd8

Browse files
committed
minor fixes
1 parent 30762dd commit 018ccd8

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/continuous.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ struct Continuous <: AbstractProcess
99
p :: Vector{Float64}
1010
function Continuous(func::Function, env::Environment, q::Vector{Float64}, p::Vector{Float64}=Float64[]; order::Number=4, stiff::Bool=false)
1111
cont = new(BaseEvent(env), func(), UInt8(order), stiff, Vector{Float64}(), Vector{Taylor1}(), Vector{Taylor1}(), p)
12+
zero_taylor = 0*Taylor1(Float64, order+1)
1213
for q₀ in q
1314
push!(cont.t, now(env))
14-
push!(cont.q, q₀ + Taylor1(Float64, order+1))
15+
push!(cont.q, q₀ + zero_taylor)
1516
end
1617
t₀ = now(env) + Taylor1(Float64, order+1)
1718
for (i, q₀) in enumerate(q)
1819
push!(cont.x, integrate(cont.f[i](t₀, cont.q, cont.p), q₀))
1920
end
2021
for i in 1:order-1
2122
for (i, xᵢ) in enumerate(cont.x)
22-
cont.q[i] = deepcopy(cont.x[i])
23+
cont.q[i] = copy(cont.x[i])
2324
end
2425
for (i, qᵢ) in enumerate(cont.q)
2526
cont.x[i] = integrate(cont.f[i](t₀, cont.q, cont.p), q[i])

src/utils/operators.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ function check(ev::AbstractEvent, op::Operator, event_state_values::Dict{Abstrac
2828
schedule(op; value=val)
2929
else
3030
event_state_values[ev] = StateValue(state(ev), val)
31-
if op.eval(collect(values(event_state_values)))
32-
schedule(op; value=event_state_values)
33-
end
31+
op.eval(collect(values(event_state_values))) && schedule(op; value=event_state_values)
3432
end
3533
elseif state(op) == scheduled
3634
if isa(val, Exception)

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ for test_file in [
1212
"finitestatemachines/transforms.jl",
1313
"coroutines.jl",
1414
"containers.jl",
15-
"stores.jl",]
15+
"stores.jl",
16+
"continuous.jl",]
1617
include(testpath(test_file))
1718
end

0 commit comments

Comments
 (0)