Skip to content

Commit 996484c

Browse files
author
Jeremiah Lewis
committed
fix
1 parent f6cd309 commit 996484c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/common/ElasticArraySARTSTraces.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ function ElasticArraySARTSTraces(;
2121
reward_eltype, reward_size = reward
2222
terminal_eltype, terminal_size = terminal
2323

24-
MultiplexTraces{SS′}(ElasticArray{state_eltype}(state_size..., Inf)) +
24+
MultiplexTraces{SS′}(ElasticArray{state_eltype}(undef, state_size..., 0)) +
2525
Traces(
26-
action = ElasticArray{action_eltype}(action_size..., Inf),
27-
reward=ElasticArray{reward_eltype}(reward_size..., Inf),
28-
terminal=ElasticArray{terminal_eltype}(terminal_size..., Inf),
26+
action = ElasticArray{action_eltype}(undef, action_size..., 0),
27+
reward=ElasticArray{reward_eltype}(undef, reward_size..., 0),
28+
terminal=ElasticArray{terminal_eltype}(undef, terminal_size..., 0),
2929
)
3030
end

src/common/ElasticArraySLARTTraces.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ function ElasticArraySLARTTraces(;
2525
reward_eltype, reward_size = reward
2626
terminal_eltype, terminal_size = terminal
2727

28-
MultiplexTraces{SS′}(ElasticArray{state_eltype}(state_size..., capacity + 1)) +
29-
MultiplexTraces{LL′}(ElasticArray{legal_actions_mask_eltype}(legal_actions_mask_size..., capacity + 1)) +
30-
MultiplexTraces{AA′}(ElasticArray{action_eltype}(action_size..., capacity + 1)) +
28+
MultiplexTraces{SS′}(ElasticArray{state_eltype}(undef, state_size..., 0)) +
29+
MultiplexTraces{LL′}(ElasticArray{legal_actions_mask_eltype}(undef, legal_actions_mask_size..., 0)) +
30+
MultiplexTraces{AA′}(ElasticArray{action_eltype}(undef, action_size..., 0)) +
3131
Traces(
32-
reward=ElasticArray{reward_eltype}(reward_size..., capacity),
33-
terminal=ElasticArray{terminal_eltype}(terminal_size..., capacity),
32+
reward=ElasticArray{reward_eltype}(undef, reward_size..., 0),
33+
terminal=ElasticArray{terminal_eltype}(undef, terminal_size..., 0),
3434
)
3535
end

test/episodes.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using ReinforcementLearningTrajectories
22
using CircularArrayBuffers
33
using Test
4+
45
@testset "EpisodesBuffer" begin
56
@testset "with circular traces" begin
67
eb = EpisodesBuffer(
@@ -282,7 +283,7 @@ using Test
282283
end
283284
@testset "with PartialNamedTuple" begin
284285
eb = EpisodesBuffer(
285-
CircularArraySARTSATraces(;
286+
ElasticArraySARTSATraces(;
286287
capacity=10)
287288
)
288289
#push a first episode l=5

0 commit comments

Comments
 (0)