marss 0.0.3

Mars celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
pub struct HabitabilityZone {
    pub name: &'static str,
    pub depth_range_m: (f64, f64),
    pub temperature_range_k: (f64, f64),
    pub water_availability: f64,
    pub energy_source: &'static str,
}

impl HabitabilityZone {
    pub fn habitability_score(&self) -> f64 {
        let temp_score =
            if self.temperature_range_k.0 >= 233.0 && self.temperature_range_k.1 <= 393.0 {
                1.0
            } else {
                0.5
            };
        let water_score = self.water_availability;
        temp_score * water_score
    }
}

pub fn subsurface_aquifer() -> HabitabilityZone {
    HabitabilityZone {
        name: "Deep subsurface aquifer",
        depth_range_m: (1_000.0, 5_000.0),
        temperature_range_k: (270.0, 350.0),
        water_availability: 0.8,
        energy_source: "Geothermal + radiolysis",
    }
}

pub fn permafrost_interface() -> HabitabilityZone {
    HabitabilityZone {
        name: "Permafrost active layer",
        depth_range_m: (0.5, 5.0),
        temperature_range_k: (200.0, 273.0),
        water_availability: 0.3,
        energy_source: "Solar (periodic)",
    }
}

pub fn cave_system() -> HabitabilityZone {
    HabitabilityZone {
        name: "Lava tube cave",
        depth_range_m: (10.0, 200.0),
        temperature_range_k: (210.0, 230.0),
        water_availability: 0.2,
        energy_source: "Chemical / radiolysis",
    }
}

pub fn habitability_zones() -> Vec<HabitabilityZone> {
    vec![subsurface_aquifer(), permafrost_interface(), cave_system()]
}

pub fn special_region_temperature_threshold_k() -> f64 {
    255.0
}

pub fn special_region_water_activity_threshold() -> f64 {
    0.5
}