From 63fe0d5d5c05e949c37e2db50c261e7394eb8ea0 Mon Sep 17 00:00:00 2001 From: mos Date: Sat, 11 Jan 2025 14:51:38 +0100 Subject: [PATCH] use DIR_POS length for direction generation --- src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7dbd711..3adfc3b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -349,10 +349,8 @@ impl Agent { const INACTIVE_PENALTY: f32 = 0.0010; const BOX_DIFF: f32 = 1024.0; - const DIR_TABLE: &'static [u32] = &[0, 1, 2, 3]; - fn chromo() -> u32 { - Self::DIR_TABLE[rnd!(Self::DIR_TABLE.len())] + rnd!(State::DIR_POS.len()) as u32 } fn with_dna(state: State, dna: Vec) -> Self {