Skip to content

Commit 1423d96

Browse files
committed
Some minor modifications
1 parent 598d087 commit 1423d96

9 files changed

Lines changed: 23 additions & 15 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ run(sim, datetime+Month(3))
9090
run(sim, 10)
9191
```
9292
* The continuous time simulation is based on a quantized state system solver. (EXPERIMENTAL)
93+
```
94+
@model function diffeq(t, x, p, dx)
95+
dx[1] = p[2]+0.01*x[2]
96+
dx[2] = p[1]-100.0*x[1]-100.0*x[2]
97+
end
98+
99+
sim = Simulation()
100+
cont = @continuous diffeq(sim, [0.0, 20.0], [2020.0, 0.0]; stiff=false, order=4)
101+
run(sim, 100)
102+
```
93103
* Documentation is automated with [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl).
94104

95105

appveyor.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
environment:
22
matrix:
3-
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
4-
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
3+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
4+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
55

66
install:
77
# Download most recent Julia Windows binary
8+
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
89
- ps: (new-object net.webclient).DownloadFile(
9-
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
10+
$env:JULIA_URL,
1011
"C:\projects\julia-binary.exe")
11-
# Run installer silently, outPut to C:\projects\julia
12+
# Run installer silently, output to C:\projects\julia
1213
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
1314

1415
build_script:

src/continuous.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
abstract type ContinuousProcess <: AbstractProcess end
2+
13
mutable struct Variable <: AbstractEvent
24
bev :: BaseEvent
35
id :: UInt
@@ -25,8 +27,7 @@ struct Handler <: AbstractEvent
2527
end
2628
end
2729

28-
29-
struct Continuous <: AbstractProcess
30+
struct Continuous <: ContinuousProcess
3031
bev :: BaseEvent
3132
vars :: Vector{Variable}
3233
function Continuous(env::Environment)

src/coroutines.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type Coroutine <: AbstractProcess
1+
type Coroutine <: DiscreteProcess
22
bev :: BaseEvent
33
fsm :: FiniteStateMachine
44
target :: AbstractEvent

src/finitestatemachines/macros.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ macro stateful(expr::Expr)
1313
type_name = gensym()
1414
slots = getSlots(expr, func_name)
1515
type_expr = :(
16-
type $type_name <: FiniteStateMachine
16+
mutable struct $type_name <: FiniteStateMachine
1717
_state :: UInt8
1818
$((:($slotname :: $(slottype == Union{} ? Any : :($slottype))) for (slotname, slottype) in slots)...)
1919
function $type_name($((:($arg::$(slots[:($arg)])) for arg in args)...))

src/odes/macros.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,3 @@ macro model(expr::Expr)
8787
Model(f, zc, $deps, $param_deps)
8888
end))
8989
end
90-
91-
macro zerocrossing(expr::Expr)
92-
expr.head != :function && error("Expression is not a function definition!")
93-
nothing
94-
end

src/processes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type Process <: AbstractProcess
1+
type Process <: DiscreteProcess
22
bev :: BaseEvent
33
task :: Task
44
target :: AbstractEvent

src/simulations.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
abstract type AbstractProcess <: AbstractEvent end
2+
abstract type DiscreteProcess <: AbstractProcess end
23

34
struct InterruptException <: Exception
45
by :: AbstractProcess

src/utils/time.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ end
99
function Timeout(env::Environment, delay::Period; priority::Int8=zero(Int8), value::Any=nothing)
1010
time = now(env)
1111
del = Base.Dates.datetime2epochms(Base.Dates.epochms2datetime(time)+delay)-time
12-
Timeout(env, del;priority=priority, value=value)
12+
Timeout(env, del; priority=priority, value=value)
1313
end
1414

1515
function nowDatetime(env::Environment)

0 commit comments

Comments
 (0)