Liking cljdoc? Tell your friends :D

automata.fsm

Finite state transducer library. Intended for data representations of state transitions, leaving actions to consumers of the library.

Finite state transducer library. Intended for data representations of
state transitions, leaving actions to consumers of the library.
raw docstring

actionclj/s

(action transition)

Yields the first action for a transition

Yields the first action for a transition
sourceraw docstring

actionsclj/s

(actions transition)

Yields all actions for a transition

Yields all actions for a transition
sourceraw docstring

and-executeclj/s

(and-execute & effects)

Define effects for a state transition

Define effects for a state transition
sourceraw docstring

invalid-statesclj/s

(invalid-states rules)

Returns a collection of invalid target states used in

Predicate to check whether a given valid ruleset provides a functioning set of rules. Rules are deemed functioning if all target states are known.

Returns a collection of invalid target states used in

Predicate to check whether a given valid ruleset provides
 a functioning set of rules. Rules are deemed functioning if
 all target states are known.
sourceraw docstring

nextclj/s

(next transition)

Yields the next state for a transition

Yields the next state for a transition
sourceraw docstring

rulesetclj/s

(ruleset & rules)

A helper to define a ruleset

A helper to define a ruleset
sourceraw docstring

transitclj/s

(transit {:automata.fsm/keys [rules state] :as machine} event)
(transit rules state event)

Given a set of rules for states, a current state and event, figure out the next state and potential side effects to perform.

Transit can either be called on a machine, i.e: a map containing the current state and rules. In this case, an updated machine map will be returned, with a potentially new state and potential actions to perform if any.

When called with the three-arity version, transition rules, state, and event are provided separately. The output is then a transition.

Both arities throw when no possible transition was found

Given a set of rules for states, a current state and event,
figure out the next state and potential side effects to perform.

Transit can either be called on a *machine*, i.e: a map containing
the current state and rules. In this case, an updated machine map
will be returned, with a potentially new state and potential actions
to perform if any.

When called with the three-arity version, transition rules, state,
and event are provided separately. The output is then a transition.

Both arities throw when no possible transition was found
sourceraw docstring

transit-toclj/s

(transit-to x)

Define the target state for a state transition

Define the target state for a state transition
sourceraw docstring

uponclj/s

(upon event new-state & [actions])

Within the context of a state transition definition, add an event transition definition.

Within the context of a state transition definition, add an event
transition definition.
sourceraw docstring

validate-rulesclj/s

(validate-rules rules)

Perform sanity checks on a rule set, intended to be ran when loading rules. Throws on badly formulated rules

Perform sanity checks on a rule set, intended to be ran when loading rules.
Throws on badly formulated rules
sourceraw docstring

with-stateclj/s

(with-state state & transitions)

Within the context of a ruleset definition, define transitions from a particular state

Within the context of a ruleset definition, define transitions from
a particular state
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close