dummy-link

SimJulia

Combined continuous time / discrete event process oriented simulation framework written in Julia

Readme

SimJulia

SimJulia is a combined continuous time / discrete event process oriented simulation framework written in Julia inspired by the Simula library DISCO, the Python library SimPy and the standalone QSS solver.

Build Status

Build Status Build status

Coverage

Coverage Status codecov.io

Installation

SimJulia.jl is a registered package, and is simply installed by running

julia> Pkg.add("SimJulia")

Package Evaluator

SimJulia SimJulia

Documentation

Release Notes

  • Version 0.4 is a complete rewrite: more julian and less pythonic.
  • Only supports Julia v0.6 and above.
  • Scheduling of events can be done with Base.Dates.Datetime and Base.Dates.Period: ``` using SimJulia using Base.Dates

function datetimetest(sim::Simulation) println(nowDatetime(sim)) yield(Timeout(sim, Day(2))) println(nowDatetime(sim)) end

datetime = now() sim = Simulation(datetime) @process datetimetest(sim) run(sim, datetime+Month(3))

* The discrete event features are on par with version 0.3. (STABLE)
* Two ways of making `Processes` are provided:
  - using the existing concept of `Tasks`:

function fibonnaci(sim::Simulation) a = 0.0 b = 1.0 while true println(now(sim), ": ", a) yield(Timeout(sim, 1)) a, b = b, a+b end end

sim = Simulation() @process fibonnaci(sim) run(sim, 10)

  - using a novel finite-statemachine approach:
``` html
@resumable function fibonnaci(sim::Simulation)
    a = 0.0
    b = 1.0
    while true
      println(now(sim), ": ", a)
      @yield return Timeout(sim, 1)
      a, b = b, a+b
    end
  end

  sim = Simulation()
  @coroutine fibonnaci(sim)
  run(sim, 10)
  • The continuous time simulation is based on a quantized state system solver. (EXPERIMENTAL) ``` @model function diffeq(t, x, p, dx) dx[1] = p[2]+0.01*x[2] dx[2] = p[1]-100.0*x[1]-100.0*x[2] end

sim = Simulation() cont = @continuous diffeq(sim, [0.0, 20.0], [2020.0, 0.0]; stiff=false, order=4) run(sim, 100)

* Documentation is automated with [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl).


#### Todo

* Transparent output processing.
* Automatically running a large number of simulations (over a parameter space) on a cluster to do simulation based optimisation.


#### Authors

* Ben Lauwens, Royal Military Academy, Brussels, Belgium


#### License

[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)

First Commit

03/23/2013

Last Touched

9 days ago

Commits

366 commits

Used By: