Skip to content

PheelaV/boids_rust_capstone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mod fv_capstone;

Capstone project: Boids algorithms

Implementatioin of boids algorithms, with integrated modified version of the original Vicsek Model, utilisinng spatial hashing, with integration into R.

cover

Boid algorithms: Crag Reynolds 1987, see see Vicsek model: Tamás Vicsek 1995, see

Implementation inspired by:

  • Daniel Shiffman, Nature of Code, see
  • Nannou, creative coding library for Rust inspired by Processing, see
  • Nature of Code, see
  • OpenSteer see
  • Eisen Daniel, see
  • Craig Bester, see
  • Hastings, Erin J. et al. “Optimization of Large-Scale , Real-Time Simulations by Spatial Hashing.” (2007)
  • Rust/R integration enabled by project extendr see

How to run/compile:

Boids simulation

  1. if you do not have Rust installed, go to rustup and follow instructions for your platform
  2. run cargo run --release in the root directory or cargo run --releae -p boids_app

Run configurations

There are several run configurations that make starting in a set state easy. You can execute any one of these by running the following commnd in the root: cargo run --release -- -c boids_app/configs/3noisy_v_s.toml

for 3noisy_v_s.toml

CLI

boids_app has a CLI for startup, you can query its parameters by running it with the -h or --help switch

Boidranalysis

  1. Ensure you have R installed, ref
  2. boidr is a package that wraps boids_lib and provides an interface into R for simulation execution and data retrieval. As of now it is unreleased and needs to be loaded for every new R session, an example is in the experiment2 at the very top bellow library imports.

Keyboard controls

  • C - controls toggle
  • R - restart simulation
  • I - double the number of agents
  • D - delete half the agents
  • X - deselect agent
  • G - toggle tails (can't update number of agents whilist active)
  • F - clustering toggle
  • X - deselect clicked agent
  • F12 - density based colouring
  • [mouse click] - select an agent
  • Spacebar - pause simulation
  • Escape - close
  • Num1 - alignment toggle
  • Num2 - cohesion toggle
  • Num3 - separation toggle
  • Num4 - wander toggle
  • A - steering toggle
  • M - freeze movement, not updates
  • Return - switch replay direction
  • Right key - step forward
  • Left key - step backward
  • F5 - separation bias toggle (if anyone is within separation distance, will ignore cohesion)
  • F8 - diagnostics
  • F9 - agent labels
  • F10 - debug distance
  • F11 - debug grid

Replay tracker (limited set)

  • C - controls toggle
  • Spacebar - pause replay
  • M - pause (separate from space)
  • X - deselect clicked agent
  • Escape - close
  • Return - switch replay direction
  • Right key - step forward
  • Left key - step backward
  • F - clustering toggle
  • F8 - diagnostics
  • F9 - agent labels
  • F10 - debug distance
  • F11 - debug grid
  • F12 - density based colours

cover

About

Final project on the Boids Algorithms

Resources

License

Stars

Watchers

Forks

Packages

No packages published