Skip to content
/ go-boids Public

Simple boids implementation in go

License

Notifications You must be signed in to change notification settings

cpcf/go-boids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-boids

A go implementation of the boids simulation described by Craig Reynolds in 1986.

https://dl.acm.org/doi/10.1145/37402.37406

Output

Runs in the terminal, using the https://github.com/charmbracelet/bubbletea framework to handle terminal output.

Scales the number of boids to the terminal size. Works best on larger terminals. Very large terminal sizes may cause performance issues.

Installation

go get github.com/cpcf/go-boids

Usage

go-boids

Parameters

Configurable parameters are set in the .env file. Resize window or restart to apply changes.

Defaults and descriptions are as follows:

FPS               = 120   # Frames per second
BOUNCE            = true  # Bounce off walls
CLAMP_MIN_SPEED   = true  # Sets the minimum speed
TARGET_MIN_SPEED  = 0.01  # Minimum speed of boid if clamped

RADIUS            = 7.0   # Tiles from boid that affect it
MAX_SPEED         = 0.5   # Maximum speed of boid
ADJUST_RATE       = 0.025 # Rate of adjustment for alignment, cohesion, and separation
ALIGNMENT_RATE    = 1.0   # Muliplier for alignment adjustment
COHESION_RATE     = 1.0   # Muliplier for cohesion adjustment
SEPARATION_RATE   = 1.0   # Muliplier for separation adjustment

About

Simple boids implementation in go

Resources

License

Stars

Watchers

Forks

Languages