Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

bml-cpp-cli is a tiny implementation of Biham-Middleton-Levine traffic model written in C++ and running in the terminal. It was made solely for fun and decorative purposes.

Currently, it only works on Linux.

Installation

Clone the repository and run the provided bml-cli binary. It was compiled using g++ 15.2.0.

Usage

Running the program is as simple as executing the provided binary. There are, however, several command line arguments to adjust the result:

  • --vertical-color or -vc: set the color of the character to be used for south-bound vehicles;
  • --horizontal-color or -hc: set the color of the character to be used for east-bound vehicles;
  • --vertical-symbol or -vs: set the character to be used for south-bound vehicles (will only take the first character from the provided string);
  • --horizontal-symbol or -hs: set the character to be used for east-bound vehicles (will only take the first character from the provided string);
  • --step-time or -st: the duration of a single simulation step in milliseconds (default 100).
  • --density or -d: the density of the vehicles on the lattice (default 0.5).

For example, running ./bml-cli -vc cyan -vs O -hc yellow -vs X -st 50 -d 0.4 will result in a cyan-yellow grid of vehicles with double the default speed and slightly lowered density.

Currently, the color options allow for input of only the basic 8 colors.

About

Biham-Middleton-Levine model in the terminal.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages