Skip to content

Commit

Permalink
Readme: references new documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
SAKryukov committed Dec 21, 2024
1 parent bd61fe7 commit 7c6b765
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,4 @@ Note that both valid and some invalid transitions can be defined. The purpose of
Both valid and invalid transitions can come with optional handlers accepting two arguments, the enumeration values representing starting and finishing states. In the case of a valid transition, the handler provides a side effect of transition.
For example, in the hardware automation applications, it can operate the hardware. In the case of an invalid transition, the handler returns a comment string explaining why the transition is not permitted.

#### Constructor:

~~~
public StateMachine(STATE initialState = default);
~~~

#### Public methods:

~~~
void ResetState(); // jump to the initial state, ignoring the transition graph
void AddValidStateTransition(STATE startState, STATE finishState,
StateTransitionAction<STATE> action, bool undirected = false);
void AddValidStateTransitionChain(
StateTransitionAction<STATE> action, bool undirected = false, params STATE[] chain);
void AddInvalidStateTransition(STATE startState, STATE finishState,
InvalidStateTransitionAction<STATE> action);
(bool isValid, string validityComment) IsTransitionValid(STATE startState, STATE finishState);
(bool success, string validityComment) TryTransitionTo(STATE state);
// Find all permitted paths between two states:
STATE[][] Labyrinth(STATE start, STATE finish, bool shortest = false);
// Find all states not visited along any of the paths between start and finish states:
(STATE[][] allPaths, STATE[] deadEnds) FindDeadEnds(STATE start, STATE finish);
STATE[] FindDeadEnds(STATE start, STATE[][] allPaths);
~~~

#### Public properties:

~~~
STATE CurrentState { get; private set; }
// NP-hard:
(int numberOfPaths, int longestPathLength, STATE[][] longestPaths) LongestPaths;
(int maximumNumberOfPaths, (STATE start, STATE finish)[] pairsAtMax) MaximumPaths;
~~~

Here, the type `STATE` is a generic parameter of the class `StateMachine<STATE>`. It can be any enumeration type, or, in principle, any type having some static public fields.
Every such field is determined through reflection and interpreted as a state, and its reflected name is interpreted as a state name.
Please see the comprehensive [API documentation](https://SAKryukov.GitHub.io/generic-state-machine).

0 comments on commit 7c6b765

Please sign in to comment.