Skip to content

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.

  • BaseBlueprint

N extends Neighborhood = "square"

new VivariumBlueprint<N>(neighborhoodName?, options?): VivariumBlueprint<N>

Defined in: blueprint/vivarium-blueprint.ts:32

N

boolean

VivariumBlueprint<N>

BaseBlueprint.constructor

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: N extends "cross" ? typeof Cross : typeof Square

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.

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.

Automaton

The compiled Automaton to pass to setup.


element(name, color, extensions?): ElementBlueprint

Defined in: blueprint/vivarium-blueprint.ts:61

Defines a new element in the vivarium.

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").

KindBlueprint[] = []

An optional array of kinds this element extends.

ElementBlueprint

An ElementBlueprint that can be used to define rules.


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.

string

A unique name identifying this kind.

KindBlueprint

A KindBlueprint that can be used to define shared rules.