Skip to content
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
13 changes: 3 additions & 10 deletions src/cddp_core/asddp_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,14 @@ CDDPSolution CDDP::solveASCDDP()

// Decrease regularization
decreaseRegularization();

// // Check termination
// if (dJ_ < options_.cost_tolerance) {
// solution.converged = true;
// break;
// }
} else {
bool early_termination_flag = false; // TODO: Improve early termination
// Increase regularization
increaseRegularization();

// If limit is reached treat as converged
if (isRegularizationLimitReached()) {
if ((dJ_ < options_.cost_tolerance * 1e2) ||
if ((dJ_ < options_.cost_tolerance * 1e1) ||
(optimality_gap_ < options_.grad_tolerance * 1e1))
{
solution.converged = true;
Expand Down Expand Up @@ -342,8 +336,8 @@ bool CDDP::solveASCDDPBackwardPass()
for (int j = 0; j < constraint_vals.size(); j++)
{
if (std::abs(constraint_vals(j)) <= active_set_tol) {
C.row(active_constraint_index) = C_state.row(j) * Fu;
D.row(active_constraint_index) = -D_state.row(j) * Fx;
C.row(active_constraint_index) = C_state.row(j) * B;
D.row(active_constraint_index) = C_state.row(j) * A;
active_constraint_index++;
}
}
Expand Down Expand Up @@ -422,7 +416,6 @@ bool CDDP::solveASCDDPBackwardPass()
// Compute optimality gap (Inf-norm) for convergence check
Qu_error = std::max(Qu_error, Q_u.lpNorm<Eigen::Infinity>());

// TODO: Add constraint optimality gap analysis
optimality_gap_ = Qu_error;
}

Expand Down
Loading