Skip to content

Commit

Permalink
lane change example works!
Browse files Browse the repository at this point in the history
  • Loading branch information
dfridovi committed Nov 25, 2024
1 parent 45f3d2c commit 6c6cfc4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions examples/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ function TrajectoryGamesBase.solve_trajectory_game!(
)
# Solve, maybe with warm starting.
if !isnothing(strategy.last_solution) && strategy.last_solution.status == :solved
println("warm start")
solution = MCPSolver.solve(
parametric_game,
parameter_value;
Expand All @@ -186,9 +185,7 @@ function TrajectoryGamesBase.solve_trajectory_game!(
y₀ = strategy.last_solution.variables.y,
)
else
println("cold start")
(; initial_state) = unpack_parameters(parameter_value; game.dynamics)
@infiltrate
solution = MCPSolver.solve(
parametric_game,
parameter_value;
Expand Down
1 change: 0 additions & 1 deletion src/game.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ function solve(
y₀ = ones(sum(game.dims.μ) + game.dims.μ̃),
tol = 1e-4,
)
@infiltrate
(; x, y, s, kkt_error, status) = solve(solver_type, game.mcp; θ, x₀, y₀, tol)

# Unpack primals per-player for ease of access later.
Expand Down
3 changes: 0 additions & 3 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ function solve(
while kkt_error > ϵ && iters < max_inner_iters
# Compute the Newton step.
# TODO! Can add some adaptive regularization.
@infiltrate
F = mcp.F(x, y, s; θ, ϵ)
@infiltrate
δz = -mcp.∇F(x, y, s; θ, ϵ) \ F
@infiltrate

# Fraction to the boundary linesearch.
δx = @view δz[1:(mcp.unconstrained_dimension)]
Expand Down

0 comments on commit 6c6cfc4

Please sign in to comment.