EventSimulation.jl
An event based Discrete Event Simulation engine for Julia.
Intended as a support library for teaching basic principles of Discrete Event Simulation.
Package features
- register/interrupt execution of events
- resource (continuous homogenous good) reservoir
- queue (arbitrary objects) reservoir
Examples
A quick start tutorial can be found here.
Examples contained in /examples/ directory:
mm1_minimal.jl: a minimal M/M/1 queue implementatongg1_minimal.jl: a minimal G/G/1 queue implementatonmms_example.jl: comparison of several implementations of M/M/s queuemm1_example.jl: basic implementation of M/M/1 queue with use of monitorbank_renege_1.jl: bank renege model (reimplementation of SimPy example)bank_renege_2.jl: bank renege model (reimplementation of SimPy example)movie_renege.jl: movie renege model (reimplementation of SimPy example)faxqueue.jl: a two-stage fax queue model; adaptation of B. Nelson (2013): Foundations and Methods of Stochastic Simulation, chap. 4.6, exampleseq_queue.jl: Experiment 4.1 from: C.-H. Chen, L.H. Lee (2011): Stochastic Simulation Optimizationrepair.jl: a rewrite of SimJulia.jl example of S. Ross (2012): Simulation, 5th edition, Section 7.7, p. 124-126computer.jl: Example 2.5 from A. Law (2013): Simulation Modeling and Analysis, 5edlookup.jl: model with s queues and s servers with different queue choice policies
The models that are reimplemnetation of SimPy run an order of magnitude (>20x) faster than in SimPy or SimJulia process oriented DES engines.
Quck overview of EventSimulation functionality
General functionality
Action: information that a given function should be executed at given timeAbstractState: abstract type used for holding global simulation stateEmptyState: simplest empty concrete subtype ofAbstractStateScheduler: central object in the library jused to store information about event queueregister!: putsActionintoSchedulerqueuerepeat_register!: putsActionintoSchedulerqueue repeatedlybulk_register!: putsActionintoSchedulerthat will affect multiple objectsrepeat_bulk_register!: putsActionintoSchedulerthat will affect multiple objects repeatedlyinterrupt!: removes one given event fromSchedulerqueueterminate!: removes all events fromSchedulerqueuego!: executes the simulation
Containers
AbstractReservoir: abstract type for defining reservoirsSimResource: reservoir for divisible and homogeneous matterResourceRequest: information about request for a resourceSimQueue: reservoir for objects having unique identityrequest!: registers demand for a resource/objectwaive!: remove registered request from waiting listprovide!: add resource/object to reservoir (or remove resource fromSimResource)withdraw!: remove object fromSimQueuelength: number of objects inSimQueue
Utilities
PriorityTime: custom subtype ofRealproviding additional attributepriorityto normal time. Useful for giving execution priority of events happening at the same time.
Full documentation of types and functions defined in EventSimulation package can be found here.