Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

change the default implementation of push! for trajectory #13

Merged
merged 1 commit into from
Jan 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,13 @@ The length of `names` and `types` must match.
end

@interface function Base.push!(t::AbstractTrajectory; kwargs...)
for (k, v) in kwargs
push!(get_trace(t, k), v)
for kv in kwargs
push!(t, kv)
end
end

@interface Base.push!(t::AbstractTrajectory, kv::Pair{Symbol})

"""
extract_transitions(trajectory::AbstractTrajectory, learner::AbstractLearner)

Expand Down