You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -146,7 +145,7 @@ function Base.push!(eb::EpisodesBuffer, xs::NamedTuple)
146
145
push!(eb.episodes_lengths, 0)
147
146
push!(eb.sampleable_inds, 0)
148
147
elseif!partial #typical inserting
149
-
ifhaskey(eb,:next_action) &&length(eb) <max_length(eb) # if trace has next_action and lengths are mismatched
148
+
ifhaskey(eb,:next_action) # if trace has next_action
150
149
if eb.step_numbers[end] >1# and if there are sufficient steps in the current episode
151
150
eb.sampleable_inds[end-1] =1# steps are indexable one step later
152
151
end
@@ -174,28 +173,6 @@ function Base.push!(eb::EpisodesBuffer, xs::PartialNamedTuple) #wrap a NamedTupl
174
173
eb.sampleable_inds[end-1] =1#completes the episode trajectory.
175
174
end
176
175
177
-
function Base.push!(eb::EpisodesBuffer{<:Any,<:Any,<:CircularArraySARTSATraces}, xs::PartialNamedTuple)
178
-
ifmax_length(eb) ==capacity(eb.traces)
179
-
popfirst!(eb)
180
-
end
181
-
push!(eb.traces, xs.namedtuple)
182
-
eb.sampleable_inds[end-1] =1#completes the episode trajectory.
183
-
end
184
-
185
-
function Base.push!(eb::EpisodesBuffer{<:Any,<:Any,<:CircularPrioritizedTraces{<:CircularArraySARTSATraces}}, xs::PartialNamedTuple{@NamedTuple{action::Int64}})
186
-
ifmax_length(eb) ==capacity(eb.traces)
187
-
addition = (name =>zero(eltype(eb.traces[name])) for name in [:state, :reward, :terminal])
0 commit comments