Skip to content

GustavoSilvera/ParallelBoids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ParallelBoids

Project for 15-418 (Spring 2021)

Gustavo Silvera & Elan Biswas

Carnegie Mellon University

Demo output with Boids coloured by FlockID

DemoImage

Read our reports

Install

You will need the following installed:

sudo apt install g++
sudo apt install build-essential
# using openmp for parallelism
sudo apt install libomp-dev
# to convert the .ppm's to .mp4
sudo apt install ffmpeg

Building

# in ParallelBoids/
make -j4 
# run executable
./Simulator

Using Cuda

We also provide a CUDA implementation of the simulator, you'll need cuda installed and nvcc available

# in ParallelBoids/
make -j4 cuda
# run executable
./CudaSimulator

Editing Params

Parameters to the program (such as #boids & #threads) can be tuned at runtime (does not require recompilation) by editing params.ini in params/params.ini

An example is shown below:

[Simulator]
num_boids=10000 # edit the number of boids
num_iters=200   # edit how long the simulator runs
num_threads=8   # how many threads are running the code
render=true     # whether or not to render the scene (adds overhead)
timestep=0.55   # global timestep for all boids (increase to make time faster)
par_flocks=true # whether or not to parallelize across flocks (vs boids)

[Boids]
boid_radius=2.0         # how large (in pixels) the boids are
cohesion=0.5            # the cohesion parameter of the boids
alignment=0.5           # the alignment parameter of the boids
separation=0.5          # the separation parameter of the boids
collision_radius=5      # the distance where boids start separating
neighbourhood_radius=10 # the distance where boids consider other boids as neighbours
max_vel=20              # maximum velocity of the boids
colour_mode=flock       # colour the boids by flock idx or thread idx

[Flocks]
use_flocks=true             # whether or not to update the flocks
max_size=500                # maximum size of the flocks
max_flock_delegation=3      # max flock delegation is depracated
is_local_neighbourhood=true # store boids in local vectors per flock (vs one giant shared one)
weight_flock_size=0.1       # how much boids weigh flock sizes when transisioning
weight_flock_dist=0.9       # how much boids weigh flock distance when transisioning

[Image]
window_x=1000 				   # horizontal size of the output image 
window_y=1000 				   # vertical size of the output image 
render_flock_bounding_box=true # option to draw red squares around flocks

[Trace]
track_mem=false        # whether the tracer should track memory (broken)
track_tick_t=true      # whether the tracer should track tick timing 
track_flock_sizes=true # whether the tracer should track flock sizes 

Using scripts

# build, init, and run the program
cd scripts/
./ParallelBoids.sh

About

CMU 15-418 Final project on parallelizing complex swarm behaviour as modeled by the Boids algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy