I love how stupid this project is

si units and redefining speed metric as thrust/weight ratio
This commit is contained in:
2026-03-04 16:30:09 -06:00
parent 216879bdd5
commit 00cc8dd9ef
19 changed files with 494 additions and 341 deletions

View File

@@ -414,28 +414,27 @@ class Pipeline:
def _stub_estimate(
self, combo: Combination, metric_names: list[str]
) -> dict[str, float]:
"""Simple heuristic estimation from dependency data."""
"""Simple heuristic estimation from dependency data (all values in SI base units)."""
raw: dict[str, float] = {m: 0.0 for m in metric_names}
# Extract intrinsic properties from entities
power_density = 0.0 # W/kg
energy_density = 0.0 # Wh/kg
mass_kg = 100.0 # default
energy_density = 0.0 # J/kg
mass = 100.0 # kg, default
for entity in combo.entities:
for dep in entity.dependencies:
if dep.key == "power_density_w_kg" and dep.constraint_type == "provides":
if dep.key == "power_density" and dep.constraint_type == "provides":
power_density = max(power_density, float(dep.value))
if dep.key == "energy_density_wh_kg" and dep.constraint_type == "provides":
if dep.key == "energy_density" and dep.constraint_type == "provides":
energy_density = max(energy_density, float(dep.value))
if dep.key == "mass_kg" and dep.constraint_type == "range_min":
mass_kg = max(mass_kg, float(dep.value))
if dep.key == "mass" and dep.constraint_type == "range_min":
mass = max(mass, float(dep.value))
# Rough speed estimate: higher power density → faster
if "speed" in raw:
raw["speed"] = min(power_density * 0.5, 300000)
if "power_density" in raw:
raw["power_density"] = power_density
if "cost_efficiency" in raw:
raw["cost_efficiency"] = max(0.01, 2.0 - power_density / 1000)
raw["cost_efficiency"] = max(1e-5, 2e-3 - power_density / 1e6)
if "safety" in raw:
raw["safety"] = 0.5
@@ -444,19 +443,19 @@ class Pipeline:
raw["availability"] = 0.5
if "range_fuel" in raw:
raw["range_fuel"] = min(energy_density * 10, 1e10)
raw["range_fuel"] = min(energy_density * 2.78, 1e13)
if "range_degradation" in raw:
raw["range_degradation"] = 365
raw["range_degradation"] = 365 * 86400
if "cargo_capacity" in raw:
raw["cargo_capacity"] = mass_kg * 0.5
raw["cargo_capacity"] = mass * 500
if "cargo_capacity_kg" in raw:
raw["cargo_capacity_kg"] = mass_kg * 0.3
raw["cargo_capacity_kg"] = mass * 0.3
if "environmental_impact" in raw:
raw["environmental_impact"] = max(0.0, power_density * 0.2)
raw["environmental_impact"] = max(0.0, power_density * 2e-7)
if "reliability" in raw:
raw["reliability"] = 0.5