Ground locomotives-page descriptor semantics
This commit is contained in:
parent
f623c6dcc9
commit
358d4cdec3
26 changed files with 1157 additions and 710 deletions
|
|
@ -5,6 +5,67 @@ import argparse
|
|||
import json
|
||||
from pathlib import Path
|
||||
|
||||
GROUNDED_LOCOMOTIVE_PREFIX = {
|
||||
1: "2-D-2",
|
||||
2: "E-88",
|
||||
3: "Adler 2-2-2",
|
||||
4: "USA 103",
|
||||
5: "American 4-4-0",
|
||||
6: "Atlantic 4-4-2",
|
||||
7: "Baldwin 0-6-0",
|
||||
8: "Be 5/7",
|
||||
9: "Beuth 2-2-2",
|
||||
10: "Big Boy 4-8-8-4",
|
||||
11: "C55 Deltic",
|
||||
12: "Camelback 0-6-0",
|
||||
13: "Challenger 4-6-6-4",
|
||||
14: "Class 01 4-6-2",
|
||||
15: "Class 103",
|
||||
16: "Class 132",
|
||||
17: "Class 500 4-6-0",
|
||||
18: "Class 9100",
|
||||
19: "Class EF 66",
|
||||
20: "Class 6E",
|
||||
21: "Consolidation 2-8-0",
|
||||
22: "Crampton 4-2-0",
|
||||
23: "DD 080-X",
|
||||
24: "DD40AX",
|
||||
25: "Duke Class 4-4-0",
|
||||
26: "E18",
|
||||
27: "E428",
|
||||
28: "Brenner E412",
|
||||
29: "E60CP",
|
||||
30: "Eight Wheeler 4-4-0",
|
||||
31: "EP-2 Bipolar",
|
||||
32: "ET22",
|
||||
33: "F3",
|
||||
34: "Fairlie 0-6-6-0",
|
||||
35: "Firefly 2-2-2",
|
||||
36: "FP45",
|
||||
37: "Ge 6/6 Crocodile",
|
||||
38: "GG1",
|
||||
39: "GP7",
|
||||
40: "H10 2-8-2",
|
||||
41: "HST 125",
|
||||
42: "Kriegslok 2-10-0",
|
||||
43: "Mallard 4-6-2",
|
||||
44: "Norris 4-2-0",
|
||||
45: "Northern 4-8-4",
|
||||
46: "Orca NX462",
|
||||
47: "Pacific 4-6-2",
|
||||
48: "Planet 2-2-0",
|
||||
49: "Re 6/6",
|
||||
50: "Red Devil 4-8-4",
|
||||
51: "S3 4-4-0",
|
||||
52: "NA-90D",
|
||||
53: "Shay (2-Truck)",
|
||||
54: "Shinkansen Series 0",
|
||||
55: "Stirling 4-2-2",
|
||||
56: "Trans-Euro",
|
||||
57: "V200",
|
||||
58: "VL80T",
|
||||
}
|
||||
|
||||
|
||||
def normalize_world_scalar_key(label: str) -> str:
|
||||
parts: list[str] = []
|
||||
|
|
@ -20,6 +81,20 @@ def normalize_world_scalar_key(label: str) -> str:
|
|||
return "world." + "_".join(parts)
|
||||
|
||||
|
||||
def locomotive_availability_label(locomotive_id: int) -> str:
|
||||
name = GROUNDED_LOCOMOTIVE_PREFIX.get(locomotive_id)
|
||||
if name is not None:
|
||||
return f"{name} Availability"
|
||||
return f"Lower-Band Locomotive Availability Slot {locomotive_id}"
|
||||
|
||||
|
||||
def locomotive_cost_label(locomotive_id: int) -> str:
|
||||
name = GROUNDED_LOCOMOTIVE_PREFIX.get(locomotive_id)
|
||||
if name is not None:
|
||||
return f"{name} Cost"
|
||||
return f"Lower-Band Locomotive Cost Slot {locomotive_id}"
|
||||
|
||||
|
||||
def classify(row: dict[str, object]) -> dict[str, object]:
|
||||
descriptor_id = int(row["descriptor_id"])
|
||||
label = str(row["label"])
|
||||
|
|
@ -71,10 +146,26 @@ def classify(row: dict[str, object]) -> dict[str, object]:
|
|||
parameter_family = "cargo_production_scalar"
|
||||
runtime_status = "executable"
|
||||
executable_in_runtime = True
|
||||
elif 241 <= descriptor_id <= 351 or 457 <= descriptor_id <= 474:
|
||||
elif 241 <= descriptor_id <= 351:
|
||||
parameter_family = "locomotive_availability_scalar"
|
||||
elif 352 <= descriptor_id <= 451 or 475 <= descriptor_id <= 502:
|
||||
locomotive_id = descriptor_id - 240
|
||||
label = locomotive_availability_label(locomotive_id)
|
||||
if locomotive_id <= len(GROUNDED_LOCOMOTIVE_PREFIX):
|
||||
runtime_status = "executable"
|
||||
executable_in_runtime = True
|
||||
elif 457 <= descriptor_id <= 474:
|
||||
parameter_family = "locomotive_availability_scalar"
|
||||
label = f"Upper-Band Locomotive Availability Slot {descriptor_id - 456}"
|
||||
elif 352 <= descriptor_id <= 451:
|
||||
parameter_family = "locomotive_cost_scalar"
|
||||
locomotive_id = descriptor_id - 351
|
||||
label = locomotive_cost_label(locomotive_id)
|
||||
if locomotive_id <= len(GROUNDED_LOCOMOTIVE_PREFIX):
|
||||
runtime_status = "executable"
|
||||
executable_in_runtime = True
|
||||
elif 475 <= descriptor_id <= 502:
|
||||
parameter_family = "locomotive_cost_scalar"
|
||||
label = f"Upper-Band Locomotive Cost Slot {descriptor_id - 474}"
|
||||
elif descriptor_id == 453:
|
||||
parameter_family = "territory_access_cost_scalar"
|
||||
runtime_status = "executable"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue