Skip to content

Commit 4bd6259

Browse files
authored
Merge pull request #31 from JuliaReinforcementLearning/findmyway-patch-1
Support Julia of a lower version
2 parents d7e482d + 6f1799d commit 4bd6259

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ notifications:
44
email: false
55
julia:
66
- 1
7+
- 1.0
78
os:
89
- linux
910
- osx

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name = "CommonRLInterface"
22
uuid = "d842c3ba-07a1-494f-bbec-f5741b0a3e98"
33
authors = ["Zachary Sunberg <[email protected]> and contributors"]
4-
version = "0.2.0"
4+
version = "0.2.1"
55

66
[deps]
77
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
88

99
[compat]
1010
MacroTools = "0.5"
11-
julia = "1.4"
11+
julia = "1"
1212

1313
[extras]
1414
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

test/runtests.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
using CommonRLInterface
22
using Test
33

4+
mutable struct LQREnv <: AbstractEnv
5+
s::Float64
6+
end
7+
48
@testset "from README" begin
5-
mutable struct LQREnv <: AbstractEnv
6-
s::Float64
7-
end
89

910
function CommonRLInterface.reset!(m::LQREnv)
1011
m.s = 0.0
1112
end
1213

13-
CommonRLInterface.actions(m::LQREnv) = (-1.0, 0.0, 1.0)
14+
CommonRLInterface.actions(m::LQREnv) = [-1.0, 0.0, 1.0]
1415
CommonRLInterface.observe(m::LQREnv) = m.s
1516
CommonRLInterface.terminated(m::LQREnv) = false
1617

@@ -40,7 +41,7 @@ MyEnv() = MyEnv(1)
4041
function CommonRLInterface.reset!(env::MyEnv)
4142
env.state = 1
4243
end
43-
CommonRLInterface.actions(env::MyEnv) = (-1, 0, 1)
44+
CommonRLInterface.actions(env::MyEnv) = [-1, 0, 1]
4445
CommonRLInterface.observe(env::MyEnv) = env.state
4546
CommonRLInterface.terminated(env::MyEnv) = false
4647
function CommonRLInterface.act!(env::MyEnv, a)
@@ -57,7 +58,7 @@ MyGame() = MyGame(1)
5758
function CommonRLInterface.reset!(env::MyGame)
5859
env.state = 1
5960
end
60-
CommonRLInterface.actions(env::MyGame) = (-1, 1)
61+
CommonRLInterface.actions(env::MyGame) = [-1, 1]
6162
CommonRLInterface.observe(env::MyGame) = env.state
6263
CommonRLInterface.terminated(env::MyGame) = false
6364
function CommonRLInterface.act!(env::MyGame, a)
@@ -140,7 +141,7 @@ end
140141
end
141142

142143
@testset "spaces" begin
143-
@provide CommonRLInterface.valid_actions(env::MyEnv) = (0, 1)
144+
@provide CommonRLInterface.valid_actions(env::MyEnv) = [0, 1]
144145
@test provided(valid_actions, env)
145146
@test issubset(valid_actions(env), actions(env))
146147

@@ -156,4 +157,6 @@ end
156157
@test observations(env) == 1:10
157158
end
158159

159-
include("examples/gridworld.jl")
160+
if VERSION >= v"1.4" # not sure if this is the actual minimal version, but I know it will work
161+
include("examples/gridworld.jl")
162+
end

0 commit comments

Comments
 (0)