API Documentation for: 0.1.0
Show:

Subsumption Class

Defined in: Subsumption:35
Module: StateJS

A simple Subsumption architecture.

Subsumption states must implement the potential method, returning true or false. This machine will verify sequentially, from the first added state to the last, if each state can execute. If the a state return true in the potential method, this machine will assume it as the current state. The tick method is only called in the current state.

Item Index

Properties

Methods

_to

(
  • name
  • state
  • name
)
private

Defined in _to:159

Change the machine to the new state.

Parameters:

  • name String

    The unique name that identifies the state.

  • state State

    The state object.

  • name String

    The state name.

add

(
  • name
  • state
)

Defined in add:69

Adds a new state to the Subsumption. The state is identified by a name, which must be unique.

Parameters:

  • name String

    The unique name that identifies the state.

  • state State

    The state object.

get

(
  • name
)
State

Defined in get:91

Returns a registered state instance by name.

Parameters:

Returns:

State:

The state.

initialize

()

Defined in initialize:58

Initialization method.

list

() Array

Defined in list:106

Returns a list of all state names registered in this machine.

Returns:

Array:

An array of state names.

name

(
  • memory
)
String

Defined in name:121

Return the name of the current state. Requires a blackboard instance.

Parameters:

  • memory statejs.Blackboard

    A Blackboard instance.

Returns:

String:

the name of the current state or null if none.

tick

(
  • target
  • memory
)

Defined in tick:132

Verifies which state will assume the current execution and propagates the update to current state.

Parameters:

  • target Object

    A target object.

  • memory statejs.Blackboard

    A Blackboard instance.

Properties

id

String

Defined in id:49

Machine unique ID.