Init project
This commit is contained in:
36
src-tauri/src/fairness.rs
Normal file
36
src-tauri/src/fairness.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
// list of algos/methods that make sure the state of the schedule is still fair
|
||||
|
||||
use crate::model::{Day, MonthlySchedule, Resident};
|
||||
|
||||
// return yes if any resident has a shift in back to bacak days
|
||||
// TODO: performance: this could only check the current recursion resident otherwise we would have cut the branch earlier
|
||||
pub fn back_to_back_shifts(schedule: &MonthlySchedule) -> bool {
|
||||
schedule.contains_any_consecutive_shifts()
|
||||
}
|
||||
|
||||
// return yes if the same resident has a shift on a sunday and also the next saturday
|
||||
pub fn sunday_and_next_saturday_shifts(schedule: &MonthlySchedule, resident: &Resident) -> bool {
|
||||
todo!()
|
||||
}
|
||||
|
||||
// find if a pair exists doing a shift at the same day, if yes return true
|
||||
pub fn pair_exists(
|
||||
schedule: &MonthlySchedule,
|
||||
resident_a: &Resident,
|
||||
resident_b: &Resident,
|
||||
) -> bool {
|
||||
todo!()
|
||||
}
|
||||
|
||||
// if day is odd then open otherwise closed
|
||||
pub fn is_closed(day: &Day) -> bool {
|
||||
todo!()
|
||||
}
|
||||
|
||||
// here include:
|
||||
// if total shifts are 50 and there are 5 residents BUT this resident has reduced workload, he should to 9 instead of 10
|
||||
// if resident has specific shift types then see he is not put in a wrong shift type
|
||||
// if resident has a max limit of shifts see that he is not doing more
|
||||
pub fn are_personal_restrictions_met(resident: &Resident) -> bool {
|
||||
todo!()
|
||||
}
|
||||
Reference in New Issue
Block a user