Skip to content

Commit

Permalink
new function: get_duration
Browse files Browse the repository at this point in the history
  • Loading branch information
aarontrowbridge committed May 10, 2024
1 parent 6bd6ac9 commit 78b0e89
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/methods_named_trajectory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export update!
export update_bound!
export get_times
export get_timesteps
export get_duration

using OrderedCollections

Expand Down Expand Up @@ -307,6 +308,15 @@ function get_timesteps(traj::NamedTrajectory)
end
end

"""
get_duration(::NamedTrajectory)
Returns the duration of a trajectory.
"""
function get_duration(traj::NamedTrajectory)
return get_times(traj)[end]
end

"""
size(traj::NamedTrajectory) = (dim = traj.dim, T = traj.T)
"""
Expand Down

0 comments on commit 78b0e89

Please sign in to comment.