SimLynx.jl Documentation
SimLynx.jl is a Julia Library that provides a Hybrid Simulation Engine and Language in Julia.
SimLynx.current_simulationSimLynx.AllocationSimLynx.NoticeSimLynx.ResourceSimLynx.SimulationSimLynx.VariableBase.getBase.scheduleSimLynx.allocateSimLynx.deallocateSimLynx.event_scheduleSimLynx.interruptSimLynx.islessorequalSimLynx.print_statsSimLynx.releaseSimLynx.requestSimLynx.resumeSimLynx.set!SimLynx.start_simulationSimLynx.suspendSimLynx.sync!SimLynx.update!SimLynx.update!SimLynx.workSimLynx.@eventSimLynx.@processSimLynx.@scheduleSimLynx.@thunkSimLynx.@with_new_simulationSimLynx.@with_resource
SimLynx.current_simulation — ConstantThe current active simulation.
SimLynx.Allocation — TypeA (unit) allocation of the resource to a process.
SimLynx.Notice — TypeA notice represents the execution of an event at some (simulated) future time.
SimLynx.Resource — TypeA sharable resource with a fixed number of allocatable units. The queue maintains a list of processes waiting for the resource.
SimLynx.Simulation — TypeA simulation represents the state of an execution. Specifically, it contains the current time, current event, future event list, and control task for the simulation.
SimLynx.Variable — TypeA variable automatically maintains the history and statistics of its value over time.
Base.get — MethodReturn the current value of a variable.
Base.schedule — Methodschedule(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.
SimLynx.allocate — MethodAllocate a unit of the resource to a process.
SimLynx.deallocate — MethodDeallocate a unit of the resource from a process.
SimLynx.event_schedule — Methodevent_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.
SimLynx.interrupt — MethodInterrupt the execution of a waiting process.
SimLynx.islessorequal — MethodAscending order function for event lists.
SimLynx.print_stats — FunctionPrint the accumulates statistics for a variable.
SimLynx.release — Methodrelease(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.
SimLynx.request — Methodrequest(resource::Resource)Request a unit of the resource. If a unit of the resource is not available, then queue the request.
SimLynx.resume — MethodResume the execution of a suspended or interrupted process.
SimLynx.set! — MethodSet the value of a variable.
SimLynx.start_simulation — Methodstart_simulation()This is the main simulation loop.
SimLynx.suspend — MethodSuspend the execution of the current process.
SimLynx.sync! — MethodSynchronize 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.
SimLynx.update! — MethodAccumulate running statistics over a time duration.
SimLynx.update! — MethodTally running statistics.
SimLynx.work — Methodwork(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.
SimLynx.@event — Macro@event <sig> begin
<body>
endDefine a simulation event with the specified signature and implemented by the given body.
SimLynx.@process — Macro@process <sig> begin
<body>
endDefine a simulation process with the specified signature and implemented by the given body.
SimLynx.@schedule — Macro@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.
SimLynx.@thunk — Macro@thunk exReturn a thunk (i.e., a function with no arguments) that executes the expression when called.
SimLynx.@with_new_simulation — Macro@with_new_simulation begin
<body>
endExecutes the body within a new simulation environment. This is the easiest way to ensure a clean simulation environment.
SimLynx.@with_resource — Macro@with_resource resource begin
body
endWrap the body in a request / release pair for the resource.
<!– @contents Pages = [ "index.md", "discrete.md", "continuous.md", "examples.md" ] –>