Skip to content

Commit

Permalink
feat: fix number of agents to 200 for reproducibility purposes + logg…
Browse files Browse the repository at this point in the history
…ing last step bird positions
  • Loading branch information
Carbonhell committed Feb 26, 2024
1 parent dbbfc02 commit f4766ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion flockers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
krabmaga = "0.4.*"
krabmaga = {path = "../../krABMaga"}

[features]
parallel = ["krabmaga/parallel"]
Expand Down
14 changes: 7 additions & 7 deletions flockers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub static TOROIDAL: bool = true;
pub static STEPS: u32 = 200;
pub static DIM_X: f32 = 800.;
pub static DIM_Y: f32 = 800.;
pub static NUM_AGENTS: u32 = 200000;
pub static NUM_AGENTS: u32 = 200;
pub static SEED: u64 = 1337;


Expand Down Expand Up @@ -170,12 +170,12 @@ fn step_system(mut query: Query<(Entity, &Bird, &DBRead<Real2DTranslation>, &DBR

let loc_x = toroidal_transform(cur_pos.x + dx, DIM_X);
let loc_y = toroidal_transform(cur_pos.y + dy, DIM_Y);
// if config.current_step == 1 || config.current_step == 2 || config.current_step == 200 {
// println!("Bird {} - Step {}: - cohesion {:?}, avoidance {:?}, consistency {:?}, randomness {:?}, mom {:?}, loc {:?}",
// bird.id, config.current_step, (x_cohesion, y_cohesion), (x_avoidance,y_avoidance), (x_consistency,y_consistency), (x_randomness, y_randomness),
// (x_momentum, y_momentum), (loc_x, loc_y));
// }
//
if config.current_step == 200 {
println!("Bird {} - Step {}: - cohesion {:?}, avoidance {:?}, consistency {:?}, randomness {:?}, mom {:?}, loc {:?}",
bird.id, config.current_step, (x_cohesion, y_cohesion), (x_avoidance,y_avoidance), (x_consistency,y_consistency), (x_randomness, y_randomness),
(x_momentum, y_momentum), (loc_x, loc_y));
}


// TODO this is ugly, but if we unify read and write buffers we'll end up querying both all the time even when it's not needed
// TODO perhaps give the user a way to query only read or both read and write, and proxy methods accordingly
Expand Down

0 comments on commit f4766ad

Please sign in to comment.