UNPKG

cacatoo

Version:

Building, exploring, and sharing spatially structured models

349 lines (330 loc) 28.2 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Cacatoo manual</title><link rel="icon" type="image/png" href="images/favicon.png" /> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/menu.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> <link href='https://fonts.googleapis.com/icon?family=Material+Icons' rel='stylesheet'> <script src="scripts/jquery.js"></script> <script src="scripts/cacatoo.js"></script> <!-- Include cacatoo library (compiled with rollup) --> <script src="scripts/all.js"></script> <!-- Include other libraries (concattenated in 1 file) --> </head> <body> <!-- --------------------- START MENU. Couldnt get it to load dynamically, so this needs to be replaced in every HTML file upon changing --------------------- --> <header class="header" id="btnNav"><buton class="header__button" id="btnNav" type="button"><i class="material-icons">menu</i></buton></header> <nav class="nav"><div class="nav__links"> <a href="#" class="nav__head"><i id="btnNavclose" class="material-icons" style="cursor:pointer"> menu </i> Cacatoo </a> <a href="index.html" id="nav__link" class="nav__link">Home</a> <a href="https://github.com/bramvandijk88/cacatoo" id="nav__link" target="_blank" class="nav__link"> Source code (Github)</a> <!-- <a href="https://replit.com/@bramvandijk88/Cacatoo-IBMs-with-examples" id="nav__link" target="_blank" class="nav__link"> Replit </a> --> <a href="#" class="nav__head"><i class="material-icons"> play_circle_outline </i> Examples</a> <a href="example_predator_prey.html" id="nav__link" class="nav__link"> Predator prey</a> <a href="example_colony_growth.html" id="nav__link" class="nav__link"> Colony growth</a> <a href="example_pheromones.html" id="nav__link" class="nav__link"> Ant pheromones</a> <a href="example_aapjes.html" id="nav__link" class="nav__link"> Aapjes (monkeys)</a> <a href="example_mutational_jackpot.html" id="nav__link" class="nav__link"> Mutational jackpot</a> <a href="example_starlings.html" id="nav__link" class="nav__link"> Starlings</a> <a href="example_cooperation.html" id="nav__link" class="nav__link"> Cooperation</a> <a href="example_TEs.html" id="nav__link" class="nav__link"> Transposon evolution</a> <a href="examples_jsfiddle.html" id="nav__link" class="nav__link"> More examples (JSFiddle)</a> <a href="#" class="nav__head"><i class="material-icons"> grid_on </i> How to Cacatoo </a> <a href="overview.html" class="nav__link"> Tutorials (Blog style)</a> <a href="list_of_options.html" class="nav__link"> All configuration options</a> <a href="populating_the_simulation.html" class="nav__link"> Populating a simulation</a> <a href="display_and_colours.html" class="nav__link"> Display, colours, and UI</a> <a href="neighbourhood_retrieval.html" class="nav__link"> Neighbourhood retrieval</a> <a href="random_numbers.html" class="nav__link"> Using random numbers </a> <a href="grid_events.html" class="nav__link"> Grid events</a> <a href="working_with_odes.html" class="nav__link"> Working with ODEs</a> <a href="jsdocs/index.html" id="nav__headlink" target="_blank" class="nav__headlink"><i class="material-icons">data_object </i> Full JS-Docs</a> </div><div class="nav__overlay"></div></nav> <script> document.addEventListener("DOMContentLoaded", () => { const nav = document.querySelector(".nav"); document.querySelector("#btnNav").addEventListener("click", () => { nav.classList.add("nav--open"); }); document.querySelector(".nav__overlay").addEventListener("click", () => { nav.classList.remove("nav--open"); }); document.querySelector("#btnNavclose").addEventListener("click", () => { nav.classList.remove("nav--open"); }); var all_links = document.getElementsByClassName("nav__link"); var hide_menu = function() { nav.classList.remove("nav--open"); }; for (var i = 0; i < all_links.length; i++) { all_links[i].addEventListener('click', hide_menu, false); } }); </script> <!-- --------------------- END MENU --------------------- --> <div id="main"> <h1 class="page-title">List of all configuration options</h1> <section> <header> </header> <article> <div class="container-overview"> <h2>Config {} - object that is passed to construct the initial simulation:</h2> <table class="params"> <thead> <tr> <th style="width:15%">Name</th> <th style="width:15%">Type</th> <th style="width:45%">Description</th> <th class="last">Default value</th> </tr> </thead> <tbody> <tr> <td class="name"> <code> title </code></td> <td class="name"><span class="param-type"> string </span></td> <td class="name"> A title for your model </td> <td class="name"> " " </td> </tr> <tr> <td class="name"> <code> description </code></td> <td class="type"><span class="param-type"> string </span></td> <td class="name"> A short description of your model </td> <td class="name"> " " </td> </tr> <tr> <td class="name"> <code> maxtime </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Duration of your simulation </td> <td class="name"> 1,000,000 </td> </tr> <tr> <td class="name"> <code> ncol </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Number of columns (width) of grid </td> <td class="name"> 100 </td> </tr> <tr> <td class="name"> <code> nrow </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Number of rows (heighth) of grid </td> <td class="name"> 100 </td> </tr> <tr> <td class="name"> <code> width </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Width of the model (for flockmodels) </td> <td class="name"> 600 </td> </tr> <tr> <td class="name"> <code> height </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Height of the model (for flockmodels) </td> <td class="name"> 600 </td> </tr> <tr> <td class="name"> <code> wrap </code></td> <td class="type"><span class="param-type"> Array(2) </span></td> <td class="name"> Wrapped boundary conditions [cols, rows] </td> <td class="name"> [true, true] </td> </tr> <tr> <td class="name"> <code> seed </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Random number seed </td> <td class="name"> 53 </td> </tr> <tr> <td class="name"> <code> skip </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Update the grid N times before displaying the grid (i.e. skip N times) </td> <td class="name"> 0 </td> </tr> <tr> <td class="name"> <code> fpsmeter </code></td> <td class="type"><span class="param-type"> boolean </span></td> <td class="name"> Show a FPS-meter in the upper-right corner </td> <td class="name"> true </td> </tr> <tr> <td class="name"> <code> sleep </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Pause X milliseconds in between time steps </td> <td class="name"> 0 </td> </tr> <tr> <td class="name"> <code> graph-interval </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Save datapoint to graph every X time steps </td> <td class="name"> 10 </td> </tr> <tr> <td class="name"> <code> graph-update </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Redraw graph every X time steps </td> <td class="name"> 50 </td> </tr> <tr> <td class="name"> <code> scale </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Size of drawn grid points in pixels </td> <td class="name"> 2 </td> </tr> <tr> <td class="name"> <code> statecolours </code></td> <td class="type"><span class="param-type"> Object <br>(or)<br> string </span></td> <td class="name"> Dictionary-style object mapping state-values to colours <br>(or)<br> name of colour map (default, random, viridis, inferno) </td> <td class="name"> "default" </td> </tr> <tr> <td class="name"> <code> num_colours </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Total number of colours generate if statecolours is one of the default colour maps </td> <td class="name"> 18 </td> </tr> <tr> <td class="name"> <code> skipbg_state </code></td> <td class="type"><span class="param-type"> boolean </span></td> <td class="name"> Do not draw the 0-state (faster) </td> <td class="name"> false </td> </tr> <tr> <td class="name"> <code> show_gridname </code></td> <td class="type"><span class="param-type"> boolean </span></td> <td class="name"> Show the gridname below the canvas </td> <td class="name"> true </td> </tr> <tr> <td class="name"> <code> printcursor </code></td> <td class="type"><span class="param-type"> boolean </span></td> <td class="name"> Upon clicking the grid, print the grid point object in the console. </td> <td class="name"> true </td> </tr> </tbody> </table> <br> <h2>Flockconfig {} - object that is passed to a new flockmodel:</h2> <table class="params"> <thead> <tr> <th style="width:15%">Name</th> <th style="width:15%">Type</th> <th style="width:45%">Description</th> <th class="last">Default value</th> </tr> </thead> <tbody> <tr> <td class="name"> <code> num_boids </code></td> <td class="name"><span class="param-type"> integer </span></td> <td class="name"> Number of boids to (auto)initialise </td> <td class="name"> 0 </td> </tr> <tr> <td class="name"> <code> shape </code></td> <td class="type"><span class="param-type"> string </span></td> <td class="name"> 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) </td> <td class="name"> "dot" </td> </tr> <tr> <td class="name"> <code> size </code></td> <td class="type"><span class="param-type"> integer </span></td> <td class="name"> Size of the boid </td> <td class="name"> 10 </td> </tr> <tr> <td class="name"> <code> init_velocity </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Initial speed of the boid </td> <td class="name"> 0 </td> </tr> <tr> <td class="name"> <code> max_speed </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Maximum speed of the boid </td> <td class="name"> 10 </td> </tr> <tr> <td class="name"> <code> max_force </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Maximum force (acceleration) added to a boid in a single timestep </td> <td class="name"> 1.5 </td> </tr> <tr> <td class="name"> <code> friction </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Velocity is multiplied by 1 minus this number each timestep. Simulates drag-less friction. </td> <td class="name"> 0.0 </td> </tr> <tr> <td class="name"> <code> click </code></td> <td class="type"><span class="param-type"> string </span></td> <td class="name"> What clicking the mouse does (repel, pull, kill,none) </td> <td class="name"> 'none' </td> </tr> <tr> <td class="name"> <code> mouseattraction </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Force applied to steer towards the mouse </td> <td class="name"> 0.0 </td> </tr> <tr> <td class="name"> <code> mouse_radius </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Size of mouse radius for hovering over boids </td> <td class="name"> 100 </td> </tr> <tr> <td class="name"> <code> draw_mouse_radius </code></td> <td class="type"><span class="param-type"> boolean </span></td> <td class="name"> Show the mouse radius when hovering </td> <td class="name"> true </td> </tr> <tr> <td class="name"> <code> alignment </code></td> <td class="type"><span class="param-type"> {object} </span></td> <td class="name"> Alignment rules of boids </td> <td class="name"> undefined (no alignment) </td> </tr> <tr> <td class="name"> <code> cohesion </code></td> <td class="type"><span class="param-type"> {object} </span></td> <td class="name"> Cohesion rules of boids </td> <td class="name"> undefined (no cohesion) </td> </tr> <tr> <td class="name"> <code> seperation </code></td> <td class="type"><span class="param-type"> {object} </span></td> <td class="name"> Seperation rules of boids </td> <td class="name"> undefined (no separation) </td> </tr> <tr> <td class="name"> <code> collision_force </code></td> <td class="type"><span class="param-type"> number </span></td> <td class="name"> Collision force of boids </td> <td class="name"> 0 </td> </tr> <tr> <td class="name"> <code> qt_colour </code></td> <td class="type"><span class="param-type"> string </span></td> <td class="name"> Colour to draw the quadtree (optimalisation algorithm) </td> <td class="name"> undefined (not drawn) </td> </tr> <tr> <td class="name"> <code> qt_capacity </code></td> <td class="type"><span class="param-type"> interger </span></td> <td class="name"> Bin size for quadtree algorithm </td> <td class="name"> 5 </td> </tr> </tbody> </table> </article> </section> </div> <div id="Navigator"></div> <br class="clear"> <script> prettyPrint();</script> <script src="scripts/linenumber.js"> </script> </body> </html>