Separate user configs from resident workload bounds

This commit is contained in:
2026-01-14 00:07:20 +02:00
parent 8865f0b95a
commit d7d4b109c3
7 changed files with 331 additions and 303 deletions

View File

@@ -164,8 +164,8 @@ mod tests {
use rstest::{fixture, rstest};
use crate::{
config::UserConfig, generator::backtracking, resident::Resident, schedule::MonthlySchedule,
slot::Slot,
bounds::WorkloadBounds, config::UserConfig, generator::backtracking, resident::Resident,
schedule::MonthlySchedule, slot::Slot,
};
#[fixture]
@@ -175,23 +175,28 @@ mod tests {
#[fixture]
fn config() -> UserConfig {
let mut config = UserConfig::default().with_residents(vec![
UserConfig::default().with_residents(vec![
Resident::new("1", "Στέφανος"),
Resident::new("2", "Ιορδάνης"),
Resident::new("3", "Μαρία"),
Resident::new("4", "Βεατρίκη"),
Resident::new("5", "Τάκης"),
Resident::new("6", "Μάκης"),
]);
config.calculate_workload_limits();
config.calculate_holiday_limits();
config.calculate_shift_type_fairness();
config
])
}
#[fixture]
fn bounds(config: UserConfig) -> WorkloadBounds {
WorkloadBounds::new_with_config(&config)
}
#[rstest]
pub fn test_export_as_doc(mut schedule: MonthlySchedule, config: UserConfig) {
backtracking(&mut schedule, Slot::default(), &config);
pub fn test_export_as_doc(
mut schedule: MonthlySchedule,
config: UserConfig,
bounds: WorkloadBounds,
) {
backtracking(&mut schedule, Slot::default(), &config, &bounds);
schedule.export_as_doc(&config);
}
}