Transition

lib/fsm~Fsm~ Transition

(protected) new Transition()

Source:

Members

(readonly) by :module:lib/fsm~Fsm~State

The symbol of the transition

Type:
Source:

(readonly) from :module:lib/fsm~Fsm~State

The source of the transition

Type:
Source:

(readonly) struct :module:lib/fsm

The accessor of the finite state machine that owns the transition

Type:
Source:

(readonly) to :module:lib/fsm~Fsm~State

The target of the transition

Type:
Source:

Methods

(static) add(descriptor) → {module:lib/fsm~Fsm~Transition}

Creates and adds a transition

If an equivalent transition already exists, the function returns it (thus failing silently)

Parameters:
Name Type Description
descriptor Object
Properties
Name Type Description
from lib/fsm~Fsm~State

source

to lib/fsm~Fsm~State

target

by lib/fsm~Fsm~Symbol

symbol

Source:
Returns:

the newly created transition

Type
module:lib/fsm~Fsm~Transition

(static) all() → {Iterator.<module:lib/fsm~Fsm~Transition>}

Source:
Returns:

every transition

Type
Iterator.<module:lib/fsm~Fsm~Transition>

(static) get(descriptor) → {module:lib/fsm~Fsm~Transition}

Get a transition

Parameters:
Name Type Description
descriptor Object
Properties
Name Type Description
from lib/fsm~Fsm~State

source

to lib/fsm~Fsm~State

target

by lib/fsm~Fsm~Symbol

symbol

Source:
Throws:

Will throw if the descriptor is invalid

Type
TypeError
Returns:
Type
module:lib/fsm~Fsm~Transition

(static) groups() → {Iterator.<Iterator.<Iterator.<module:lib/fsm~Fsm~Transition>>>}

Creates nested iterators The transitions are first split by their source state, then their target states

Source:
Returns:

the collection

Type
Iterator.<Iterator.<Iterator.<module:lib/fsm~Fsm~Transition>>>

(static) remove(transition) → {module:lib/fsm}

Removes a transition

Parameters:
Name Type Description
transition module:lib/fsm~Fsm~Transition

transition to remove

Source:
Returns:

the finite state machine

Type
lib/fsm

(static) select(selector) → {Iterator.<module:lib/fsm~Fsm~Transition>}

Creates an iterator of transitions that match the selector attributes

Parameters:
Name Type Description
selector Object
Properties
Name Type Attributes Description
from lib/fsm~Fsm~State <nullable>

source

to lib/fsm~Fsm~State <nullable>

target

by lib/fsm~Fsm~Symbol <nullable>

symbol

Source:
Returns:

the selected transitions

Type
Iterator.<module:lib/fsm~Fsm~Transition>