Add a perturbation step to the VNS engine #305
@ -12,8 +12,9 @@ module Tables
|
||||
def call
|
||||
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(&:reset)
|
||||
|
||||
new_solution
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user