use DIR_POS length for direction generation
This commit is contained in:
parent
556fc664bc
commit
63fe0d5d5c
|
@ -349,10 +349,8 @@ impl Agent {
|
||||||
const INACTIVE_PENALTY: f32 = 0.0010;
|
const INACTIVE_PENALTY: f32 = 0.0010;
|
||||||
const BOX_DIFF: f32 = 1024.0;
|
const BOX_DIFF: f32 = 1024.0;
|
||||||
|
|
||||||
const DIR_TABLE: &'static [u32] = &[0, 1, 2, 3];
|
|
||||||
|
|
||||||
fn chromo() -> u32 {
|
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<u32>) -> Self {
|
fn with_dna(state: State, dna: Vec<u32>) -> Self {
|
||||||
|
|
Loading…
Reference in New Issue