Skip swap between members of the same group
Some checks failed
Run unit tests / unit_tests (pull_request) Failing after 14s
Some checks failed
Run unit tests / unit_tests (pull_request) Failing after 14s
This commit is contained in:
parent
093970b2af
commit
ecbabf6cbd
@ -8,6 +8,8 @@ module Tables
|
|||||||
def each
|
def each
|
||||||
@initial_solution.tables.combination(2) do |table_a, table_b|
|
@initial_solution.tables.combination(2) do |table_a, table_b|
|
||||||
table_a.swap_candidates.product(table_b.swap_candidates).each do |(person_a, person_b)|
|
table_a.swap_candidates.product(table_b.swap_candidates).each do |(person_a, person_b)|
|
||||||
|
next if person_a.affinity_group_list.first == person_b.affinity_group_list.first
|
||||||
|
|
||||||
new_solution = @initial_solution.dup
|
new_solution = @initial_solution.dup
|
||||||
|
|
||||||
new_table_a = table_a.dup
|
new_table_a = table_a.dup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user