Skip to content

Commit 9aa76bb

Browse files
committed
Small tweaks
1 parent 1835329 commit 9aa76bb

4 files changed

Lines changed: 22 additions & 24 deletions

File tree

src/SimJulia.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
isdefined(Base, :__precompile__) && __precompile__()
22

33
"""
4-
`SimJulia`
5-
64
Main module for SimJulia.jl – a combined continuous time / discrete event process oriented simulation framework for Julia.
75
"""
86
module SimJulia

src/events.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ Timeout{E<:Environment} <: AbstractEvent{E}
3333
3434
**Field**:
3535
36-
- `bev :: BaseEvent{E}`
36+
- bev :: BaseEvent{E}
3737
3838
**Constructors**:
3939
40-
- `Timeout{E<:Environment}(env::E, delay::Period; priority::Bool=false, value::Any=nothing) :: Timeout{E}`
41-
- `Timeout{E<:Environment}(env::E, delay::Number=0; priority::Bool=false, value::Any=nothing) :: Timeout{E}`
40+
- Timeout{E<:Environment}(env::E, delay::Period; priority::Bool=false, value::Any=nothing)
41+
- Timeout{E<:Environment}(env::E, delay::Number=0; priority::Bool=false, value::Any=nothing)
4242
"""
4343

4444
type Timeout{E<:Environment} <: AbstractEvent{E}

src/process.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Process{E<:Environment} <: AbstractEvent{E}
1111
1212
**Fields**:
1313
14-
- `bev :: BaseEvent{E}`
15-
- `task :: Task`
16-
- `target :: AbstractEvent{E}`
17-
- `resume :: Function`
14+
- bev :: BaseEvent{E}
15+
- task :: Task
16+
- target :: AbstractEvent{E}
17+
- resume :: Function
1818
1919
**Constructor**:
2020
21-
Process{E<:Environment}(func::Function, env::E, args::Any...) :: Process{E}
21+
Process{E<:Environment}(func::Function, env::E, args::Any...)
2222
"""
2323
type Process{E<:Environment} <: AbstractEvent{E}
2424
bev :: BaseEvent{E}

src/simulation.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ Simulation{T<:TimeType} <: Environment
1818
1919
**Fields**:
2020
21-
- `time :: T`
22-
- `heap :: PriorityQueue{BaseEvent{Simulation{T}}, EventKey{T}}`
23-
- `eid :: UInt`
24-
- `sid :: UInt`
25-
- `active_proc :: Nullable{Process}`
21+
- time :: T
22+
- heap :: PriorityQueue{BaseEvent{Simulation{T}}, EventKey{T}}
23+
- eid :: UInt
24+
- sid :: UInt
25+
- active_proc :: Nullable{Process}
2626
2727
**Constructors**:
2828
29-
- `Simulation{T<:TimeType}(initial_time::T) :: Simulation{T}`
30-
- `Simulation(initial_time::Number=0) :: Simulation{SimulationTime}`
29+
- Simulation{T<:TimeType}(initial_time::T) :: Simulation{T}
30+
- Simulation(initial_time::Number=0) :: Simulation{SimulationTime}
3131
3232
An initial_time for the simulation can be specified. By default, it starts at 0.
3333
"""
@@ -54,7 +54,7 @@ end
5454
Returns the current simulation time.
5555
5656
**Method**:
57-
`now{T<:TimeType}(sim::Simulation{T}) :: T`
57+
now{T<:TimeType}(sim::Simulation{T}) :: T
5858
"""
5959
function now{T<:TimeType}(sim::Simulation{T}) :: T
6060
sim.time
@@ -90,7 +90,7 @@ Does a simulation step and processes the next event.
9090
9191
**Method**:
9292
93-
`step(sim::Simulation) :: Bool`
93+
step(sim::Simulation) :: Bool
9494
"""
9595
function step(sim::Simulation)
9696
if isempty(sim.heap)
@@ -120,10 +120,10 @@ If the stepping end with a `StopSimulation` exception the function return the va
120120
121121
**Methods**:
122122
123-
- `run(sim::Simulation, until::AbstractEvent) :: Any`
124-
- `run{T<:TimeType}(sim::Simulation{T}, until::T) :: Any`
125-
- `run(sim::Simulation, period::Union{Period, Number}) :: Any`
126-
- `run(sim::Simulation) :: Any`
123+
- run(sim::Simulation, until::AbstractEvent) :: Any
124+
- run{T<:TimeType}(sim::Simulation{T}, until::T) :: Any
125+
- run(sim::Simulation, period::Union{Period, Number}) :: Any
126+
- run(sim::Simulation) :: Any
127127
"""
128128
function run{T<:TimeType}(sim::Simulation{T}, until::AbstractEvent{Simulation{T}}) :: Any
129129
append_callback(stop_simulation, until)
@@ -154,7 +154,7 @@ end
154154

155155
function schedule{T<:TimeType}(bev::BaseEvent{Simulation{T}}, delay::Period; priority::Bool=false, value::Any=nothing)
156156
bev.value = value
157-
bev.env.heap[bev] = EventKey(bev.env.time + delay, priority, bev.env.sid+=one(UInt))
157+
bev.env.heap[bev] = EventKey{T}(bev.env.time + delay, priority, bev.env.sid+=one(UInt))
158158
bev.state = scheduled
159159
end
160160

0 commit comments

Comments
 (0)