Skip to content

Commit 8d3a477

Browse files
authored
Update simulations.jl
Addition of a function now(ev::Event). The function is similar to call now(environment(ev)) but allows shortcuts when writing event callbacks using the simulation time.
1 parent 1d6b04c commit 8d3a477

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/simulations.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ function now(sim::Simulation)
4444
sim.time
4545
end
4646

47+
function now(ev::Event)
48+
return now(environment(ev))
49+
end
50+
4751
function active_process(sim::Simulation) :: AbstractProcess
4852
get(sim.active_proc)
4953
end

0 commit comments

Comments
 (0)