## module:Logic()

definitions of logic states and basic logic functions used in the simulation

#### new module:Logic()
`modules/Logic.js`, `line 5`

### Members

#### static state :Number
`modules/Logic.js`, `line 16`

  Enum for logic states.

  States:

  - `off`
  - `on`
  - `unknown`
  - `oscillating`

#### static stateList :Array
`modules/Logic.js`, `line 31`

  list of all states that can be used in the simulation

  This getter iterates over Logic.state and returns an array containing all values of Logic.state's members

### Methods

#### static and(a, b) → {Logic.state}
`modules/Logic.js`, `line 48`

  Logic AND

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state
  `b` | Logic.state | second input state

  ##### Returns:

  Logic.state -

  output state

#### static nand(a, b) → {Logic.state}
`modules/Logic.js`, `line 71`

  Logic NAND

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state
  `b` | Logic.state | second input state

  ##### Returns:

  Logic.state -

  output state

#### static nor(a, b) → {Logic.state}
`modules/Logic.js`, `line 81`

  Logic NOR

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state
  `b` | Logic.state | second input state

  ##### Returns:

  Logic.state -

  output state

#### static not(a) → {Logic.state}
`modules/Logic.js`, `line 90`

  Logic NOT

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state

  ##### Returns:

  Logic.state -

  output state

#### static or(a, b) → {Logic.state}
`modules/Logic.js`, `line 106`

  Logic OR

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state
  `b` | Logic.state | second input state

  ##### Returns:

  Logic.state -

  output state

#### static runSymmetricRules(a, b, rules) → {Logic.state}
`modules/Logic.js`, `line 169`

  Finds the correct rule in the array of rules and returns the corresponding return value. This function expects rules to be symmetric (so `a RULE b` should returns the same value as `b RULE a`), which allows to cut down on the `rules` array quite a bit

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state
  `b` | Logic.state | second input state
  `rules` | Array | Array of arrays. Each inner array represents a rule in the format [input1, input2, output]. The function finds an array, where `a === input1` and `b === input1` (or `a === input2` and `b === input1`) and returns `output` from this array.

  ##### Returns:

  Logic.state -

  output state

#### static xnor(a, b) → {Logic.state}
`modules/Logic.js`, `line 130`

  Logic XNOR

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state
  `b` | Logic.state | second input state

  ##### Returns:

  Logic.state -

  output state

#### static xor(a, b) → {Logic.state}
`modules/Logic.js`, `line 140`

  Logic XOR

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Logic.state | first input state
  `b` | Logic.state | second input state

  ##### Returns:

  Logic.state -

  output state