mod analysis;
mod analyzer;
mod regression;
mod types;
pub use analyzer::ThermalAnalyzer;
pub use types::{
CooldownRecommendation, RiskCategory, ThermalCorrelation, ThermalPrediction, ThermalSample,
ThermalVariance, ThrottleRisk,
};
pub const DEFAULT_THROTTLE_THRESHOLD_C: f64 = 85.0;
pub const MIN_SAMPLES_FOR_ANALYSIS: usize = 3;
pub fn analyze_thermal(
samples: &[(f64, f64)], horizon_sec: f64,
) -> Option<ThermalPrediction> {
let mut analyzer = ThermalAnalyzer::new(samples.len());
for &(temp, time) in samples {
analyzer.add(temp, time);
}
analyzer.predict_trend(horizon_sec)
}
pub fn assess_throttle_risk(current_temp: f64, threshold: f64, trend_slope: f64) -> ThrottleRisk {
ThrottleRisk::assess(current_temp, threshold, trend_slope, 10.0)
}
#[cfg(test)]
mod tests;