Class Index | File Index

Classes


Built-In Namespace _global_

Field Summary
Field Attributes Field Name and Description
 
Below are a few global functions that are used by Simulation classes, but not a method of a Simulation instance per se
Method Summary
Method Attributes Method Name and Description
 
CopyGridODEs(cols, rows, template)
Make a back-up of all the ODE states (for synchronous ODE updating)
 
Reverse dictionary
 
Reconstruct a 2D array based on a canvas
 
hexToRGB(hex)
Convert hexadecimal to RGB
 
MakeGrid(cols, rows, template)
Make a grid, or when a template is given, a COPY of a grid.
 
nameToRGB(name)
Convert colour name to RGB
 
Make sure all colours, even when of different types, are stored in the same format (RGB, as cacatoo uses internally)
 
shuffle(array, rng)
Randomly shuffle an array with custom RNG
 
stringToRGB(string)
Convert colour string to RGB.
Field Detail
pause
Below are a few global functions that are used by Simulation classes, but not a method of a Simulation instance per se
Defined in: cacatoo.js.
Method Detail
CopyGridODEs(cols, rows, template)
Make a back-up of all the ODE states (for synchronous ODE updating)
Defined in: cacatoo.js.
Parameters:
{int} cols
Width of the grid
{int} rows
Height of the grid
{2DArray} template
Get ODE states from here

dict_reverse(obj)
Reverse dictionary
Defined in: cacatoo.js.
Parameters:
{Object} obj
dictionary-style object to reverse in order

{2DArray} get2DFromCanvas(canvas)
Reconstruct a 2D array based on a canvas
Defined in: cacatoo.js.
Parameters:
{canvas} canvas
HTML canvas element to convert to a 2D grid for Cacatoo
Returns:
{2DArray} Returns a 2D array (i.e. a grid) with the states

hexToRGB(hex)
Convert hexadecimal to RGB
Defined in: cacatoo.js.
Parameters:
{String} hex
string to convert to RGB

MakeGrid(cols, rows, template)
Make a grid, or when a template is given, a COPY of a grid.
Defined in: cacatoo.js.
Parameters:
{int} cols
Width of the new grid
{int} rows
Height of the new grid
{2DArray} template
Template to be used for copying (if not set, a new empty grid is made)

nameToRGB(name)
Convert colour name to RGB
Defined in: cacatoo.js.
Parameters:
{String} name
string to look up in the set of known colours (see below)

parseColours(cols)
Make sure all colours, even when of different types, are stored in the same format (RGB, as cacatoo uses internally)
Defined in: cacatoo.js.
Parameters:
{Array} cols
array of strings, or [R,G,B]-arrays. Only strings are converted, other returned.

shuffle(array, rng)
Randomly shuffle an array with custom RNG
Defined in: cacatoo.js.
Parameters:
{Array} array
array to be shuffled
{MersenneTwister} rng
MersenneTwister RNG

stringToRGB(string)
Convert colour string to RGB. Works for colour names ('red','blue' or other colours defined in cacatoo), but also for hexadecimal strings
Defined in: cacatoo.js.
Parameters:
{String} string
string to convert to RGB

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Sep 08 2021 21:24:30 GMT+0200 (CEST)