SimLynx.jl Documentation

SimLynx.jl is a Julia Library that provides a Hybrid Simulation Engine and Language in Julia.

SimLynx.NoticeType

A notice represents the execution of an event at some (simulated) future time.

source
SimLynx.ResourceType

A sharable resource with a fixed number of allocatable units. The queue maintains a list of processes waiting for the resource.

source
SimLynx.SimulationType

A simulation represents the state of an execution. Specifically, it contains the current time, current event, future event list, and control task for the simulation.

source
SimLynx.VariableType

A variable automatically maintains the history and statistics of its value over time.

source
Base.scheduleMethod
schedule(notice::Notice)
schedule(sim::Simulation, notice::Notice)

Schedule the notice on the future event list for the specified simulation, which defaults to the current simulation.

source
SimLynx.event_scheduleMethod
event_schedule(notice::Notice, event_list::Array{Notice, 1})

Add a notice to the given event list. This routine keeps the event list in sorted (ascending) order.

source
SimLynx.releaseMethod
release(resource::Resource)

Release a unit of the resource. If there are process queued for the resource, then allocate a unit of the resource to the longest waiting process. Note that this works for unit allocations.

source
SimLynx.requestMethod
request(resource::Resource)

Request a unit of the resource. If a unit of the resource is not available, then queue the request.

source
SimLynx.sync!Method

Synchronize the history and statistics for a variable. This is called before the value of a variable is changed, via set!, and before the history or statistics are used.

source
SimLynx.workMethod
work(delay::Real)

Simulate the delay while work is being done. Add an event to return to this task in the future to the event list.

source
SimLynx.@eventMacro
@event <sig> begin
    <body>
end

Define a simulation event with the specified signature and implemented by the given body.

source
SimLynx.@processMacro
@process <sig> begin
    <body>
end

Define a simulation process with the specified signature and implemented by the given body.

source
SimLynx.@scheduleMacro
@schedule now <expr>
@schedule at <time> <expr>
@schedule in <delta> <expr>

Schedule an event to occur in the future. The create an event and adds it to the future event list at the specified time.

source
SimLynx.@thunkMacro
@thunk ex

Return a thunk (i.e., a function with no arguments) that executes the expression when called.

source
SimLynx.@with_new_simulationMacro
@with_new_simulation begin
    <body>
end

Executes the body within a new simulation environment. This is the easiest way to ensure a clean simulation environment.

source

<!– @contents Pages = [ "index.md", "discrete.md", "continuous.md", "examples.md" ] –>