Add a perturbation step to the VNS engine #305
@ -11,9 +11,10 @@ module Tables
|
|||||||
|
|
||||||
def call
|
def call
|
||||||
new_solution = @initial_solution.deep_dup
|
new_solution = @initial_solution.deep_dup
|
||||||
|
|
||||||
selected_guests = new_solution.tables.map(&:pop).cycle.tap(&:next)
|
selected_guests = new_solution.tables.map(&:pop).shuffle.cycle
|
||||||
new_solution.tables.each { |table| table << selected_guests.next }
|
new_solution.tables.each { |table| table << selected_guests.next }
|
||||||
|
new_solution.tables.each(&:reset)
|
||||||
|
|
||||||
new_solution
|
new_solution
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user