Skip to content

Commit f47bac2

Browse files
committed
found missing constants
1 parent 6ed4137 commit f47bac2

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

constants/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "constants"
3+
version = "0.1.0"
4+
authors = ["Phillip Neal <philn1984@gmail.com>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]

constants/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
pub const WIDTH: f32 = 400.0; //width and height of
2+
pub const HEIGHT: f32 = 400.0; //screen
3+
pub const NUM_NEURONS: usize = 8; //should be powers of 2
4+
pub const NUM_BRAINS: usize = 10; //number of brains -- in ga talk population
5+
pub const NUM_ANGLES: usize = 8; //rover has 8 possible directions it can travel
6+
//e,ne,n,nw,w,sw,s,se -- kind of like the unit circle in trig
7+
pub const ANGLES_DX: [f32; 8] = [1.0, 1.0, 0.0, -1.0, -1.0, -1.0, 0.0, 1.0];
8+
pub const ANGLES_DY: [f32; 8] = [0.0, 1.0, 1.0, 1.0, 0.0, -1.0, -1.0, -1.0];
9+
pub const NUM_SENSORS: usize = 3; //number of antennae
10+
pub const SENSOR_LENGTH: f32 = 60.0; //length of an antenna
11+
pub const MAX_LOOP_KNT: usize = 2000; //can't let them live forever
12+
13+

main/src/.main.rs.swp

-16 KB
Binary file not shown.

0 commit comments

Comments
 (0)