Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d7d970a
Duration Constraint
BBhattacharyya1729 Apr 21, 2025
f4513fd
Merge remote-tracking branch 'upstream/main'
BBhattacharyya1729 May 1, 2025
b9981a7
free phases
andgoldschmidt May 3, 2025
acf0de1
intro global constraints / objectives, constraints to use global dim …
andgoldschmidt May 5, 2025
55e0a8b
Added Pairwise
BBhattacharyya1729 May 6, 2025
66f6941
clean
andgoldschmidt May 7, 2025
3d9e65a
Merge branch 'main' of github.com:harmoniqs/DirectTrajOpt.jl into fea…
andgoldschmidt May 7, 2025
aec79a7
Merge branch 'main' of github.com:harmoniqs/DirectTrajOpt.jl into fea…
andgoldschmidt May 7, 2025
8d936fe
refactor to separate pure knot point from global mixed
andgoldschmidt May 9, 2025
5c009eb
check overlapping constraint for zero reset
andgoldschmidt May 10, 2025
da8a5be
add reset for global nonlinear constraint
andgoldschmidt May 10, 2025
b2deb0f
min time obj free time only
andgoldschmidt May 19, 2025
6f9db34
added duration and symmetry consraints
BBhattacharyya1729 May 28, 2025
dcc5643
Update regularizers.jl
BBhattacharyya1729 May 28, 2025
ef4657a
Merge branch 'harmoniqs:main' into Feature/DurationSymmetry
BBhattacharyya1729 May 28, 2025
dd18f16
Merge branch 'main' into feature/free-phases
andgoldschmidt Jun 4, 2025
d7781ab
update global data
andgoldschmidt Jun 5, 2025
5911dc1
refactor NT concrete
Jun 7, 2025
1ffee19
update for new NT
Jun 13, 2025
c0213ea
added tests for symmetry and duration constraints
BBhattacharyya1729 Jun 16, 2025
9b6f1e7
Fixed duration/symmetry constraint tests
BBhattacharyya1729 Jun 16, 2025
1b07173
update for parametric NT, test global obj and constraints
andgoldschmidt Jun 17, 2025
e9623fb
Merge remote-tracking branch 'bikrant/Feature/DurationSymmetry' into …
andgoldschmidt Jun 18, 2025
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
Prev Previous commit
Next Next commit
min time obj free time only
  • Loading branch information
andgoldschmidt committed May 19, 2025
commit b2deb0fd9a36fee350662f54b6e2879c04a58ddc
31 changes: 10 additions & 21 deletions src/objectives/minimum_time_objective.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,19 @@ A type of objective that counts the time taken to complete a task. `D` is a sca
"""
function MinimumTimeObjective(
traj::NamedTrajectory;
D::Float64=1.0,
timesteps_all_equal::Bool=false,
D::Float64=1.0
)
@assert traj.timestep isa Symbol "Trajectory timestep must be a symbol (free time)"

if !timesteps_all_equal
Δt_indices = [index(t, traj.components[traj.timestep][1], traj.dim) for t = 1:traj.T-1]

L = Z⃗::AbstractVector{<:Real} -> D * sum(Z⃗[Δt_indices])

∇L = (Z⃗::AbstractVector{<:Real}) -> begin
∇ = zeros(eltype(Z⃗), length(Z⃗))
∇[Δt_indices] .= D
return ∇
end
else
Δt_T_index = index(traj.T, traj.components[traj.timestep][1], traj.dim)
L = Z⃗::AbstractVector{<:Real} -> D * Z⃗[Δt_T_index]
∇L = (Z⃗::AbstractVector{<:Real}) -> begin
∇ = zeros(eltype(Z⃗), length(Z⃗))
∇[Δt_T_index] = D
return ∇
end

Δt_index = traj.components[traj.timestep][1]
Δt_indices = [index(t, Δt_index, traj.dim) for t = 1:traj.T-1]

L = Z⃗::AbstractVector{<:Real} -> D * sum(Z⃗[Δt_indices])

∇L = (Z⃗::AbstractVector{<:Real}) -> begin
∇ = zeros(eltype(Z⃗), length(Z⃗))
∇[Δt_indices] .= D
return ∇
end

∂²L = Z⃗::AbstractVector{<:Real} -> []
Expand Down