Only include potential guests in the simulation
This commit is contained in:
parent
8d09fd733f
commit
50a5c90728
@ -7,7 +7,7 @@ class TableSimulatorJob < ApplicationJob
|
|||||||
engine.add_perturbation(Tables::Swap)
|
engine.add_perturbation(Tables::Swap)
|
||||||
|
|
||||||
initial_solution = Tables::Distribution.new(min_per_table: 8, max_per_table: 10)
|
initial_solution = Tables::Distribution.new(min_per_table: 8, max_per_table: 10)
|
||||||
initial_solution.random_distribution(Guest.all.shuffle)
|
initial_solution.random_distribution(Guest.potential.shuffle)
|
||||||
|
|
||||||
engine.initial_solution = initial_solution
|
engine.initial_solution = initial_solution
|
||||||
|
|
||||||
|
@ -8,9 +8,11 @@ class Guest < ApplicationRecord
|
|||||||
invited: 10,
|
invited: 10,
|
||||||
confirmed: 20,
|
confirmed: 20,
|
||||||
declined: 30,
|
declined: 30,
|
||||||
tentative: 40,
|
tentative: 40
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scope :potential, -> { where.not(status: %i[declined considered]) }
|
||||||
|
|
||||||
def full_name
|
def full_name
|
||||||
"#{first_name} #{last_name}"
|
"#{first_name} #{last_name}"
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user