VivariumBlueprint
Defined in: blueprint/vivarium-blueprint.ts:12
The main builder for defining a vivarium. Use it to create elements, kinds, and rules, then call create to produce an Automaton that can be passed to setup.
Extends
Section titled “Extends”BaseBlueprint
Type Parameters
Section titled “Type Parameters”N extends Neighborhood = "square"
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new VivariumBlueprint<
N>(neighborhoodName?,options?):VivariumBlueprint<N>
Defined in: blueprint/vivarium-blueprint.ts:32
Parameters
Section titled “Parameters”neighborhoodName?
Section titled “neighborhoodName?”N
options?
Section titled “options?”wrapping?
Section titled “wrapping?”boolean
Returns
Section titled “Returns”VivariumBlueprint<N>
Overrides
Section titled “Overrides”BaseBlueprint.constructor
Properties
Section titled “Properties”helpers
Section titled “helpers”helpers:
Helpers
Defined in: blueprint/vivarium-blueprint.ts:30
Helper functions for constructing count arrays used in conditions. Includes not, between, even, and odd.
neighbor
Section titled “neighbor”neighbor:
Nextends"cross"? typeofCross: typeofSquare
Defined in: blueprint/vivarium-blueprint.ts:24
Named constants for referring to specific positions in the neighborhood. Available positions depend on the neighborhood type.
For "square": TOP_LEFT, TOP, TOP_RIGHT, LEFT, SELF, RIGHT, BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT.
For "cross": TOP, LEFT, SELF, RIGHT, BOTTOM.
Methods
Section titled “Methods”create()
Section titled “create()”create():
Automaton
Defined in: blueprint/vivarium-blueprint.ts:106
Finalizes the vivarium and produces an Automaton object. After calling this method, no further elements, kinds, or rules can be added.
Returns
Section titled “Returns”Automaton
The compiled Automaton to pass to setup.
element()
Section titled “element()”element(
name,color,extensions?):ElementBlueprint
Defined in: blueprint/vivarium-blueprint.ts:61
Defines a new element in the vivarium.
Parameters
Section titled “Parameters”string
A unique name identifying this element.
string
A unique color used to draw this element. Accepts CSS named colors or hex values (e.g. "green", "#FF7A45").
extensions?
Section titled “extensions?”KindBlueprint[] = []
An optional array of kinds this element extends.
Returns
Section titled “Returns”An ElementBlueprint that can be used to define rules.
kind()
Section titled “kind()”kind(
name):KindBlueprint
Defined in: blueprint/vivarium-blueprint.ts:85
Defines a new kind in the vivarium. A kind groups elements that share common behavior.
Parameters
Section titled “Parameters”string
A unique name identifying this kind.
Returns
Section titled “Returns”A KindBlueprint that can be used to define shared rules.