Skip to content

Commit

Permalink
Fix the test for a domain being continuous
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Jul 22, 2024
1 parent c718119 commit af5e884
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/LocalSearchSolvers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ using Dictionaries
using Distributed
using JSON
using Lazy
using TestItems

# Exports internal
export constraint!, variable!, objective!, add!, add_var_to_cons!, add_value!
Expand Down
11 changes: 5 additions & 6 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ end
Runs an iteration of coordinate descent over axis "x".
The derivative is (temporarily?) computed via finite difference.
The step size is determined via the Armijo condition for line search.
The step size is determined via the Armijo condition for line search.
"""
function _coordinate_descent_move!(s, x)
current_value = _value(s, x)
Expand Down Expand Up @@ -412,13 +412,12 @@ function _step!(s)
x = _select_worse(s)
_verbose(s, "Selected x = $x")

if _value(s, x) isa Int
# Local move (change the value of the selected variable)
best_values, best_swap, tabu = _move!(s, x)
# _compute!(s)
else
if get_domain(s, x) isa ContinuousDomain
# We perform coordinate descent over the variable axis
best_values, best_swap, tabu = _coordinate_descent_move!(s, x)
else
# Local move (change the value of the selected variable)
best_values, best_swap, tabu = _move!(s, x)
end

# If local move is bad (tabu), then try permutation
Expand Down

0 comments on commit af5e884

Please sign in to comment.