Skip to content

Commit 01e8117

Browse files
committed
add a comment
1 parent 3495151 commit 01e8117

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/trajectory.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ Supported methoes are:
2020
- `take!(t::Trajectory)`, take a batch of experiences from the trajectory. Note
2121
that `nothing` may be returned, indicating that it's not ready to sample yet.
2222
"""
23-
Base.@kwdef struct Trajectory{C,S,T}
23+
Base.@kwdef struct Trajectory{C,S,T,F}
2424
container::C
2525
sampler::S = DummySampler()
2626
controller::T = InsertSampleRatioController()
27-
transformer::Any = identity
27+
transformer::F = identity
2828

2929
function Trajectory(c::C, s::S, t::T=InsertSampleRatioController(), f=identity) where {C,S,T}
3030
if c isa EpisodesBuffer
31-
new{C,S,T}(c, s, t, f)
31+
new{C,S,T,typeof(f)}(c, s, t, f)
3232
else
3333
eb = EpisodesBuffer(c)
34-
new{typeof(eb),S,T}(eb, s, t, f)
34+
new{typeof(eb),S,T,typeof(f)}(eb, s, t, f)
3535
end
3636
end
3737

@@ -63,7 +63,7 @@ Base.@kwdef struct Trajectory{C,S,T}
6363
bind(controller.ch_in, t)
6464
bind(controller.ch_out, t)
6565

66-
new{C,S,T}(container, sampler, controller, transformer)
66+
new{C,S,T,typeof(transformer)}(container, sampler, controller, transformer)
6767
end
6868
end
6969

@@ -105,7 +105,7 @@ function Base.push!(t::Trajectory, x)
105105
on_insert!(t, x)
106106
end
107107

108-
function Base.push!(t::Trajectory, x::PartialNamedTuple)
108+
function Base.push!(t::Trajectory, x::PartialNamedTuple) #used at EpisodesBuffer
109109
push!(t.container, x)
110110
on_insert!(t, x.namedtuple)
111111
end

0 commit comments

Comments
 (0)