ioss 0.0.3

Io celestial simulation crate for the MilkyWay SolarSystem workspace
Documentation
use std::thread;
use std::time::Duration;

fn main() {
    let jupiter = ioss::interactions::jupiters::ensure_jupiters_binary_or_simulate();
    let orbit = ioss::physics::orbit::IoOrbit::new();
    let rotation = ioss::physics::rotation::IoRotation::new();
    let landing_site = ioss::geodata::landing_sites::loki_patera();
    let exosphere = ioss::exosphere::species::reference_composition();
    let thermal = ioss::environment::thermal::ThermalEnvironment {
        local_time_hours: ioss::IO_DAY_HOURS * 0.5,
        latitude_deg: landing_site.latitude_deg,
        shadowed: false,
    };
    let sulfur = ioss::resources::sulfur::loki_deposits();
    let jupiter_view = ioss::observation::jupiter_view::JupiterView::sub_jupiter_default();
    let thermal_k = thermal.surface_temperature_k();
    let startup_score = ioss::H24_RUNTIME_HOURS as f64
        + jupiter.orbital_radius_km / 1.0e6
        + jupiter.orbital_period_days / 365.0
        + jupiter.orbital_angle_deg / 360.0
        + jupiter.rotation_period_h / 24.0
        + jupiter.rotation_angle_deg / 360.0
        + jupiter.axial_tilt_deg / 90.0
        + jupiter.surface_speed_m_s / 1_000.0
        + orbit.semi_major_axis_m / 1.0e9
        + orbit.orbital_period_s() / 1.0e6
        + rotation.sidereal_period_s / 1.0e6
        + landing_site.latitude_deg.abs() / 90.0
        + landing_site.longitude_deg.abs() / 180.0
        + exosphere.len() as f64
        + thermal_k / 1_000.0
        + sulfur.estimated_mass_kg.log10().max(0.0)
        + if jupiter_view.is_visible() { 1.0 } else { 0.0 }
        + if landing_site.name.is_empty() {
            0.0
        } else {
            1.0
        }
        + if matches!(
            jupiter.mode,
            ioss::interactions::jupiters::JupiterRuntimeMode::Binary
        ) {
            1.0
        } else {
            0.5
        };
    let heartbeat = if startup_score.is_finite() && startup_score > 0.0 {
        Duration::from_secs(60)
    } else {
        Duration::from_secs(5)
    };

    loop {
        thread::sleep(heartbeat);
    }
}