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

@@ -74,8 +74,8 @@ class TestScorer:
Entity(name="ICE", dimension="actuator"),
])
combo.id = 1
raw = {"speed": 60.0, "cost_efficiency": 0.5, "safety": 0.7,
"availability": 0.8, "range_fuel": 400}
raw = {"power_density": 500.0, "cost_efficiency": 5e-4, "safety": 0.7,
"availability": 0.8, "range_fuel": 400000}
result = scorer.score_combination(combo, raw)
assert 0.0 < result.composite_score <= 1.0
assert len(result.scores) == 5
@@ -85,8 +85,8 @@ class TestScorer:
scorer = Scorer(urban_domain)
combo = Combination(entities=[])
combo.id = 1
raw = {"speed": 60.0, "cost_efficiency": 0.5, "safety": 0.0,
"availability": 0.8, "range_fuel": 400}
raw = {"power_density": 500.0, "cost_efficiency": 5e-4, "safety": 0.0,
"availability": 0.8, "range_fuel": 400000}
result = scorer.score_combination(combo, raw)
assert result.composite_score == 0.0
@@ -95,13 +95,13 @@ class TestScorer:
scorer = Scorer(urban_domain)
combo = Combination(entities=[])
combo.id = 1
# cost_efficiency: norm_min=0.01, norm_max=2.0, lower_is_better=True
# A low cost (0.02) should get a HIGH normalized score (near 1.0)
# A high cost (1.9) should get a LOW normalized score (near 0.0)
raw_cheap = {"speed": 60.0, "cost_efficiency": 0.02, "safety": 0.7,
"availability": 0.8, "range_fuel": 400}
raw_expensive = {"speed": 60.0, "cost_efficiency": 1.9, "safety": 0.7,
"availability": 0.8, "range_fuel": 400}
# cost_efficiency: norm_min=1e-5, norm_max=2e-3, lower_is_better=True
# A low cost (2e-5) should get a HIGH normalized score (near 1.0)
# A high cost (1.9e-3) should get a LOW normalized score (near 0.0)
raw_cheap = {"power_density": 500.0, "cost_efficiency": 2e-5, "safety": 0.7,
"availability": 0.8, "range_fuel": 400000}
raw_expensive = {"power_density": 500.0, "cost_efficiency": 1.9e-3, "safety": 0.7,
"availability": 0.8, "range_fuel": 400000}
result_cheap = scorer.score_combination(combo, raw_cheap)
result_expensive = scorer.score_combination(combo, raw_expensive)