Skip to content

Commit 518e0e4

Browse files
authored
Merge pull request #8 from rejuvyesh/jkg/stepreset
Fix some step/reset usage
2 parents bf99cf6 + 06115c5 commit 518e0e4

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

environments/ant/methods/env.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function ant(;
7676
return env
7777
end
7878

79-
function step(env::Environment{Ant}, x, u;
79+
function Base.step(env::Environment{Ant}, x, u;
8080
gradients=false,
8181
attitude_decompress=false)
8282

environments/pendulum/methods/env.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function get_observation(env::Environment{Pendulum})
9999
end
100100
end
101101

102-
function step(env::Environment{Pendulum}, x, u;
102+
function Base.step(env::Environment{Pendulum}, x, u;
103103
gradients=false,
104104
attitude_decompress=false)
105105
mechanism = env.mechanism

test/mechanism.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
env = Dojo.get_environment("pendulum",
55
timestep=timestep,
66
gravity=-10.0);
7-
Dojo.reset(env);
7+
reset(env);
88
Dojo.initialize_pendulum!(env.mechanism,
99
angle=0.25 * π)
1010
u1 = rand(Dojo.input_dimension(env.mechanism))
@@ -33,7 +33,7 @@
3333
env = Dojo.get_environment("halfcheetah",
3434
timestep=timestep,
3535
gravity=-10.0);
36-
Dojo.reset(env);
36+
reset(env);
3737

3838
# get body
3939
@test Dojo.get_body(env.mechanism, :origin).name == :origin
@@ -50,7 +50,7 @@
5050
env2 = Dojo.get_environment(:halfcheetah,
5151
timestep=timestep,
5252
gravity=-10.0);
53-
Dojo.reset(env);
53+
reset(env);
5454
Dojo.set_maximal_state!(env2.mechanism, zeros(Dojo.maximal_dimension(env2.mechanism)))
5555
z2 = Dojo.get_maximal_state(env2.mechanism)
5656
@test norm(z2) < 1.0e-8

test/simulate.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
env = Dojo.get_environment("pendulum",
44
timestep=0.1,
55
gravity=0.0);
6-
Dojo.reset(env);
6+
reset(env);
77

88
# step (no control)
99
z1 = Dojo.get_maximal_state(env.mechanism)
@@ -22,7 +22,7 @@ end
2222
# get environment and simulate
2323
env = Dojo.get_environment("pendulum",
2424
timestep=0.1);
25-
Dojo.reset(env);
25+
reset(env);
2626
Dojo.initialize_pendulum!(env.mechanism,
2727
angle=0.25 * π)
2828
storage = Dojo.simulate!(env.mechanism, 1.0,
@@ -37,4 +37,4 @@ end
3737
s = Dojo.generate_storage(env.mechanism, z)
3838
@test typeof(s) <: Dojo.Storage
3939
@test Dojo.length(s) == 10
40-
end
40+
end

test/visuals.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ end
2929
# get environment and simulate
3030
env = Dojo.get_environment("halfcheetah",
3131
timestep=0.1)
32-
Dojo.reset(env)
32+
reset(env)
3333
storage = Dojo.simulate!(env.mechanism, 0.25,
3434
record=true,
3535
verbose=true);
@@ -43,7 +43,7 @@ end
4343
vis = Dojo.Visualizer();
4444
# get environment and simulate
4545
env = Dojo.get_environment("quadruped", timestep=0.1)
46-
Dojo.reset(env)
46+
reset(env)
4747
storage = Dojo.simulate!(env.mechanism, 0.25,
4848
record=true,
4949
verbose=false)

0 commit comments

Comments
 (0)