Symbol

Symbol

new Symbol(nameopt, tauopt, sigmaopt)

Description:
  • Creates a macroscopic ersatz of a VSA symbol.

    • For convenience the constructs
      • Symbol(String name, double tau, double sigma)
      • Symbol(String name, const Belief& belief)
Parameters:
Name Type Attributes Default Description
name String | Symbol <optional>

The symbol name.

  • If omitted, the name is set to #id where id is an automatic unique number, see getID().
  • If given as a symbol, the symbol name is used.
tau double <optional>
1

The symbol degree of belief.

sigma double <optional>
0

The symbol standard-deviation of the related level of noise.

Members

belief :Belief

Description:
  • The degree of belief

    • tau between -1 (false), 0 (unknown) and true (1), 1 by default and
    • sigma the standard-deviation of the related level of noise, 0 by default.

The degree of belief

  • tau between -1 (false), 0 (unknown) and true (1), 1 by default and
  • sigma the standard-deviation of the related level of noise, 0 by default.
Type:

Methods

getName() → {String}

Description:
  • Returns the symbol name.

Returns:

The read-only symbol name value.

Type
String

getID() → {uint}

Description:
  • Returns the symbol ID.

    • This ID is a unique number for a given symbol.
      • Two scalar symbols with the same ID are equal, possibly with different belief level.
      • This does not apply to non scalar symbols: binding or bundling.
Returns:

The read-only symbol id value.

Type
uint

getVector() → {Array}

Description:
  • Returns a randomly drawn unary vector coresponding to this symbol.

Returns:

The double[] read-only symbol vector value.

Type
Array

equals(symbol) → {bool}

Description:
  • Tests if two symbol are indistiguishable.

    • Two symbols are ``colinear´´ if they have the same ID.
    • Two symbols are ``indistiguishable´´ if colinear and with the same belief, up to some precision (here 1e-6).
Parameters:
Name Type Description
symbol Symbol

The symbol to compare with this one.

Returns:

True if equal, false otherwise.

Type
bool

asString() → {String}

Description:
  • Returns the value as a string.

Returns:

A string of the form name_type<tau+-sigma>:

  • omitting the belief if tau=1, sigma=0,
  • adding the _type if it is a _bundling or a _binding and ommiting the type if it is a scalar symbol.
Type
String

(static) getDimension() → {uint}

Description:
  • Returns the underlying VSA space dimension.

Returns:

The VSA space dimension, default value is d=10000.

Type
uint

(static) setDimension(The)

Description:
  • Changes the underlying VSA space dimension.

    • All computed values are reseted.
Parameters:
Name Type Description
The uint

new VSA space dimension. It must be a square of an integer.

dump()

Description:
  • Prints on stdout, for debugging and statistics purposes, global informations.