Improve type system with ResidentId and ToxicPair structs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
bounds::WorkloadBounds, config::UserConfig, schedule::MonthlySchedule,
|
||||
bounds::WorkloadBounds, config::UserConfig, resident::ResidentId, schedule::MonthlySchedule,
|
||||
slot::Slot,
|
||||
};
|
||||
|
||||
@@ -16,6 +16,7 @@ impl Scheduler {
|
||||
}
|
||||
|
||||
pub fn run(&self, schedule: &mut MonthlySchedule) -> bool {
|
||||
schedule.prefill(&self.config);
|
||||
self.search(schedule, Slot::default())
|
||||
}
|
||||
|
||||
@@ -66,7 +67,7 @@ impl Scheduler {
|
||||
}
|
||||
|
||||
/// Return all valid residents for the current slot
|
||||
pub fn valid_residents(&self, slot: Slot, schedule: &MonthlySchedule) -> Vec<String> {
|
||||
pub fn valid_residents(&self, slot: Slot, schedule: &MonthlySchedule) -> Vec<ResidentId> {
|
||||
let other_slot_resident_id = schedule.get_resident_id(&slot.other_position());
|
||||
|
||||
self.config
|
||||
@@ -144,7 +145,4 @@ mod tests {
|
||||
|
||||
println!("{}", schedule.pretty_print(&scheduler.config));
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_valid_residents(mut schedule: MonthlySchedule, scheduler: Scheduler) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user