fix(simulation): replace f32 fields in generator with integer types

BlockPlacement.street_width_factor (f32) → street_width_bps (u16,
basis points where 10000 = 1.0×). BlockSkeleton.density (f32) →
density_pct (u8, 0–100 percentage). Eliminates latent f32
non-determinism per D-010 principle 1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 23:25:02 +01:00
co-authored by Claude Opus 4.6
parent 339f112c8f
commit d3217c5ae3
+6 -4
View File
@@ -301,8 +301,9 @@ pub struct BlockPlacement {
pub offset: (i16, i16),
/// Rotation in 15° increments (03, max 45°).
pub rotation_steps: u8,
/// Street width multiplier (0.752.0; default 1.0 = 4 visual tiles).
pub street_width_factor: f32,
/// Street width in basis points (10000 = 1.0×, range 750020000 for 0.752.0×).
/// Default 10000 = 4 visual tiles. Uses integer to avoid f32 non-determinism (D-010).
pub street_width_bps: u16,
}
/// Single block within a district's 4×4 block grid.
@@ -319,8 +320,9 @@ pub struct BlockSkeleton {
pub era: Era,
pub era_modifications: Vec<EraModification>,
pub era_cause: Option<EraCause>,
/// Build density scalar (0.0 = open/empty, 1.0 = fully built-up).
pub density: f32,
/// Build density percentage (0 = open/empty, 100 = fully built-up).
/// Integer to avoid f32 non-determinism (D-010).
pub density_pct: u8,
pub landmark: Option<LandmarkSlot>,
}