Remove min by shift type boundaries, improve logging, add more tests, add logs in tests, move fixtures in separate file, move restrictions_violated logic into valid_residents of next slot

This commit is contained in:
2026-02-21 23:46:26 +02:00
parent c291328bfa
commit a41d1cd469
15 changed files with 856 additions and 453 deletions

View File

@@ -1,5 +1,6 @@
use std::io;
use log::Level;
use serde::Serialize;
use thiserror::Error;
@@ -18,6 +19,16 @@ pub enum SearchError {
NoSolutionFound,
}
impl SearchError {
pub fn log_level(&self) -> Level {
match self {
SearchError::SolutionFound | SearchError::ScheduleFull => Level::Info,
SearchError::NoSolutionFound => Level::Warn,
SearchError::Timeout | SearchError::Config(_) => Level::Error,
}
}
}
impl From<anyhow::Error> for SearchError {
fn from(err: anyhow::Error) -> Self {
SearchError::Config(err.to_string())