callistos 0.0.3

Callisto celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct IceDeposit {
    pub region_name: &'static str,
    pub estimated_mass_kg: f64,
    pub purity_fraction: f64,
}

impl IceDeposit {
    pub fn extractable_water_kg(&self, recovery_efficiency: f64) -> f64 {
        self.estimated_mass_kg * self.purity_fraction * recovery_efficiency.clamp(0.0, 1.0)
    }
}

pub fn valhalla_deposit() -> IceDeposit {
    IceDeposit {
        region_name: "Valhalla subsurface",
        estimated_mass_kg: 5.0e12,
        purity_fraction: 0.45,
    }
}

pub fn annual_life_support_people(deposit: IceDeposit, kg_per_person_per_year: f64) -> f64 {
    deposit.extractable_water_kg(0.7) / kg_per_person_per_year.max(1.0)
}