Skip to content

Commit

Permalink
heuristic #1
Browse files Browse the repository at this point in the history
  • Loading branch information
sshin23 committed Sep 19, 2021
1 parent ee903c5 commit 492b35b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
23 changes: 22 additions & 1 deletion src/interiorpointsolver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
k::Int = 0 # total iteration counter
l::Int = 0 # backtracking line search counter
t::Int = 0 # restoration phase counter
r::Int = 0

start_time::Float64

Expand Down Expand Up @@ -740,7 +741,25 @@ function regular!(ips::AbstractInteriorPointSolver)
ips.filter,theta,theta_trial,varphi,varphi_trial,switching_condition,armijo_condition,
ips.theta_min,ips.opt.obj_max_inc,ips.opt.gamma_theta,ips.opt.gamma_phi,
has_constraints(ips))
ips.ftype in ["f","h"] && (@trace(ips.logger,"Step accepted with type $(ips.ftype)"); break)
if ips.ftype in ["f","h"] ||
(ips.cnt.l==1 && theta_trial>=theta &&
second_order_correction(
ips,alpha_max,theta,varphi,theta_trial,varphi_d,switching_condition))

@trace(ips.logger,"Step accepted with type $(ips.ftype)")
break
elseif ips.cnt.r >= ips.opt.filter_reset_trigger
# prevent filter reset
switching_condition = true
armijo_condition = true
if ips.theta_max > theta_trial / 10
ips.theta_max /= 10
ips.filter = [(ips.theta_max,-Inf)]
break
# else
# break
end
end

ips.cnt.l==1 && theta_trial>=theta && second_order_correction(
ips,alpha_max,theta,varphi,theta_trial,varphi_d,switching_condition) && break
Expand All @@ -759,6 +778,8 @@ function regular!(ips::AbstractInteriorPointSolver)
SOLVED_TO_ACCEPTABLE_LEVEL : SEARCH_DIRECTION_BECOMES_TOO_SMALL
end
end

ips.cnt.l == 1 ? (ips.cnt.r = 0) : (ips.cnt.r += 1)

@trace(ips.logger,"Updating primal-dual variables.")
ips.x.=ips.x_trial
Expand Down
3 changes: 2 additions & 1 deletion src/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ end
kappa_sigma::Float64 = 1e10
barrier_tol_factor::Float64 = 10.
rho::Float64 = 1000.

filter_reset_trigger::Int = 5

# Barrier
mu_init::Float64 = 1e-1
mu_min::Float64 = 1e-11
Expand Down

0 comments on commit 492b35b

Please sign in to comment.