Config {} - object that is passed to construct the initial simulation:
Name | Type | Description | Default value |
---|---|---|---|
title |
string | A title for your model | " " |
description |
string | A short description of your model | " " |
maxtime |
integer | Duration of your simulation | 1,000,000 |
ncol |
integer | Number of columns (width) of grid | 100 |
nrow |
integer | Number of rows (heighth) of grid | 100 |
width |
number | Width of the model (for flockmodels) | 600 |
height |
number | Height of the model (for flockmodels) | 600 |
wrap |
Array(2) | Wrapped boundary conditions [cols, rows] | [true, true] |
seed |
integer | Random number seed | 53 |
skip |
integer | Update the grid N times before displaying the grid (i.e. skip N times) | 0 |
fpsmeter |
boolean | Show a FPS-meter in the upper-right corner | true |
sleep |
integer | Pause X milliseconds in between time steps | 0 |
graph-interval |
integer | Save datapoint to graph every X time steps | 10 |
graph-update |
integer | Redraw graph every X time steps | 50 |
scale |
integer | Size of drawn grid points in pixels | 2 |
statecolours |
Object (or) string |
Dictionary-style object mapping state-values to colours (or) name of colour map (default, random, viridis, inferno) |
"default" |
num_colours |
integer | Total number of colours generate if statecolours is one of the default colour maps | 18 |
skipbg_state |
boolean | Do not draw the 0-state (faster) | false |
show_gridname |
boolean | Show the gridname below the canvas | true |
printcursor |
boolean | Upon clicking the grid, print the grid point object in the console. | true |
Flockconfig {} - object that is passed to a new flockmodel:
Name | Type | Description | Default value |
---|---|---|---|
num_boids |
integer | Number of boids to (auto)initialise | 0 |
shape |
string | What type of shape the boid takes. Options are dot, square, arrow, bird, line, ant, png (png requires boid.png to contain a path to the png file) | "dot" |
size |
integer | Size of the boid | 10 |
init_velocity |
number | Initial speed of the boid | 0 |
max_speed |
number | Maximum speed of the boid | 10 |
max_force |
number | Maximum force (acceleration) added to a boid in a single timestep | 1.5 |
friction |
number | Velocity is multiplied by 1 minus this number each timestep. Simulates drag-less friction. | 0.0 |
click |
string | What clicking the mouse does (repel, pull, kill,none) | 'none' |
mouseattraction |
number | Force applied to steer towards the mouse | 0.0 |
mouse_radius |
number | Size of mouse radius for hovering over boids | 100 |
draw_mouse_radius |
boolean | Show the mouse radius when hovering | true |
alignment |
{object} | Alignment rules of boids | undefined (no alignment) |
cohesion |
{object} | Cohesion rules of boids | undefined (no cohesion) |
seperation |
{object} | Seperation rules of boids | undefined (no separation) |
collision_force |
number | Collision force of boids | 0 |
qt_colour |
string | Colour to draw the quadtree (optimalisation algorithm) | undefined (not drawn) |
qt_capacity |
interger | Bin size for quadtree algorithm | 5 |