@@ -222,29 +222,27 @@ end
222222
223223 # EpisodesBuffer
224224 t = CircularPrioritizedTraces (
225- CircularArraySARTSTraces (;
225+ CircularArraySARTSATraces (;
226226 capacity= 10
227227 ),
228228 default_priority= 1.0f0
229229 )
230-
230+
231231 eb = EpisodesBuffer (t)
232- push! (eb, (state = 1 , action = 1 ))
232+ push! (eb, (state = 1 ,))
233233 for i = 1 : 5
234- push! (eb, (state = i+ 1 , action = i+ 1 , reward = i, terminal = false ))
234+ push! (eb, (state = i+ 1 , action = i, reward = i, terminal = false ))
235235 end
236- push! (eb, (state = 7 , action = 7 ))
236+ push! (eb, PartialNamedTuple ((action = 6 ,)))
237+ push! (eb, (state = 7 ,))
237238 for (j,i) = enumerate (8 : 11 )
238- push! (eb, (state = i, action = i, reward = i- 1 , terminal = false ))
239+ push! (eb, (state = i, action = i- 1 , reward = i- 1 , terminal = false ))
239240 end
241+ push! (eb, PartialNamedTuple ((action= 12 ,)))
240242 s = BatchSampler (1000 )
241243 b = sample (s, eb)
242244 cm = counter (b[:state ])
243245 @test ! haskey (cm, 6 )
244246 @test ! haskey (cm, 11 )
245247 @test all (in (keys (cm)), [1 : 5 ;7 : 10 ])
246-
247-
248- eb[:priority , [1 , 2 ]] = [0 , 0 ]
249- @test eb[:priority ] == [zeros (2 );ones (8 )]
250248end
0 commit comments