Global

Members

lastResetTime :Float

Monitors how often the reset button is pushed. This helps provide debouncing of the reset button when it is used on mobile devices.
Type:
  • Float
Source:

nodes :Array.<GraphNodes>

The generated lattice nodes
Type:
  • Array.<GraphNodes>
Source:

refreshTime :Integer

The number of seconds to wait before auto reset.
Type:
  • Integer
Source:

refreshTimeDisplay :p5.element

Handler for the paragraphs that displays the current refresh time.
Type:
  • p5.element
Source:

refreshTimeSlider :p5.element

Handler for the refresh time slider.
Type:
  • p5.element
Source:

resetButton :p5.element

Handler for the reset button
Type:
  • p5.element
Source:

spacing :Integer

The pixel spacing between lattice nodes on the canvas.
Type:
  • Integer
Source:

verticalGridPoints :Integer

The number of lattice nodes on the vertical axis of the grid.
Type:
  • Integer
Source:

verticalGridPointsDisplay :p5.element

Handler for the paragraphs that displays the current grid size.
Type:
  • p5.element
Source:

verticalGridPointsSlider :p5.element

Handler for the number of grid points slider.
Type:
  • p5.element
Source:

walk :Array.<GraphNode>

The generated random self avoiding walk
Type:
Source:

Methods

contains(nodesList, nodeIndecies) → {boolean}

Checks to see if a GraphNode list contains a given node.
Parameters:
Name Type Description
nodesList Array.<GraphNode> The list of nodes
nodeIndecies Array.<Integer> The lattice indecies. Should not have more than 2 elements representing the components for each lattice vector.
Source:
Returns:
Boolean true if the node is in the list.
Type
boolean

draw()

p5.js draw function, is run every frame to create the desired animation
Source:

generateTriangleGrid()

Generate a graph of nodes arranged in a triangular pattern
Source:

generateWalk()

Generates a random walk given a list of nodes in a grid
Source:

getNodeFromList(nodesList, nodeIndecies) → {GraphNode}

Gets the node specified by the lattice indecies from the list.
Parameters:
Name Type Description
nodesList Array.<GraphNode> The list of nodes
nodeIndecies Array.<Integer> The lattice indecies. Should not have more than 2 elements representing the components for each lattice vector.
Source:
Returns:
The node from list.
Type
GraphNode

reset()

Resets the canvas and draws a new random walk.
Source:

setup()

p5.js setup function, creates canvas.
Source:

Documentation generated by JSDoc 3.6.3 on Sun Jun 05 2022 19:55:55 GMT+0100 (BST)