use crate::entropy::ENTROPY_THRESHOLD;
pub const MIN_FILE_SIZE: u64 = 100 * 1024 * 1024;
pub const ELIGIBLE_SCORE: f64 = 0.95;
#[derive(Debug, Clone)]
pub struct EligibilityInput {
pub file_size: u64,
pub gpu_available: bool,
pub entropy: f64,
}
#[derive(Debug, Clone)]
pub struct EligibilityResult {
pub score: f64,
pub file_size_ok: bool,
pub gpu_ok: bool,
pub entropy_ok: bool,
}
impl EligibilityResult {
#[must_use]
pub fn evaluate(input: &EligibilityInput) -> Self {
let file_size_ok = input.file_size > MIN_FILE_SIZE;
let gpu_ok = input.gpu_available;
let entropy_ok = input.entropy <= ENTROPY_THRESHOLD;
let score = if file_size_ok && gpu_ok && entropy_ok {
ELIGIBLE_SCORE
} else {
0.0
};
Self {
score,
file_size_ok,
gpu_ok,
entropy_ok,
}
}
}