(released 2023-02-23)
- updated compat
- removed multi-threading (parallel clocks) from export and docs
(released 2020-09-16) A few days after the release of v0.3.0 Hector Perez contributed some macros to make the DiscreteEvents
API more Julian for common cases:
@event
: wrapsfun
andevent!
into one call,@periodic
: wrapsfun
andperiodic!
into one call,@process
: wrapsPrc
andprocess!
into one call,@wait
: simplified call ofwait!
,
The following macros provide syntactic sugar to existing functions:
@delay
: callsdelay!
,@run!
: callsrun!
.
(released 2020-09-11) v0.3.0 was a significant improvement over 0.2.0 with a name change, multi-threading, resource handling and a streamlined documentation (announcement on Julia discourse).
- following the advice on discourse and in
issue #13
Simulate.jl
was renamed toDiscreteEvents.jl
. Github maintains and forwards the links. - there are further renamings to make the API more consistent:
Simfunction
→fun
,SF
is no longer defined,SimProcess
→Prc
,SP
is no longer defined,SimEvent
→DiscreteEvent
,SimCond
→DiscreteCond
,sample!
→periodic!
, was a name collision withDistributions.jl
.reset!
→resetClock!
, was a name collision withDataStructures.jl
- the documentation has been reduced to minimal introductory examples and API documentation,
- everything else (explanations, further examples, notebooks, benchmarks) has been moved to a companion site: DiscreteEventsCompanion.
Action
is introduced as synonym forUnion{Function,Expr,Tuple}
,- thereby in addition to
fun
, you can now schedule arbitrary function closures as events, periodic!
takes anAction
as argument,- you can pass also symbols, expressions or other
fun
s or function closures as arguments tofun
. They get evaluated at event time before being passed to the event function, DiscreteEvents.version
gives now the package version,DiscreteEvents.jl
is now much faster due to optimizations,onthread
allows simulations with asynchronous tasks (processes and actors) to run much faster on threads other than 1,Resource
provides an API for modeling limited resources,- you can now create a real time clock
RTClock
and schedule events to it (experimental), - actors can register their message channels to the
clock.channels
vector and the clock will not proceed before they are empty, - processes and actors (asynchronous tasks) can transfer IO-operations to the clock with
now!
or print directly via the clock, event!
anddelay!
now also accept stochastic time variables (aDistribution
),- there is a
n
keyword parameter for the number of repeatevent!
s, - you can seed the thread-specific RNGs with
pseed!
.
- The data structure of
Clock
has been changed, it now has a fieldac
providing channels to parallel clocks, PClock
sets up a clock with parallel active clocks on each available thread,- with
pclock
all parallel clocks can be accessed and referenced, process!
can now start tasks on parallel threads,event!
can now schedule events for execution on parallel threads,periodic!
can now register sampling functions or expressions to parallel clocks,- if setup with parallel clocks,
Clock
becomes the master to drive them and synchronize with them at eachΔt
time step,
τ
as an alias fortau
is no longer defined.- The macros
@tau
,@val
,@SF
,@SP
are no longer defined. - Logging functions have been removed (they were not useful enough).
- A function
f
given toPrc
must now take aClock
-variable as its first argument. - The first
::Clock
-argument todelay!
andwait!
andnow!
can no longer be omitted. Since the task function has now aClock
-variable available (see above), it must provide it todelay!
,wait!
andnow
. event!
no longer accepts aVector
as argument.Clk
as alias of𝐶
is no longer provided.event!
now returns nothing.event!
andperiodic!
now doesn't take anymore the scope as an argument. Symbols or expressions given to them or included infun
s are only evaluated inMain
scope: this feature therefore can be used only by end users but not by any packages usingDiscreteEvents.jl
.
- Evaluating expressions or symbols at global scope is much slower than using functions and gives now a one time warning. This functionality may be removed entirely in a future version. (Please write an issue if you want to keep it.)