[This is preliminary documentation and is subject to change.]
Given a stream of values and a stream of initial states associated with nodes, maintains a state machine for each node,
and produces outputs on each transition, based on the given transitionSelector.
Namespace: Microsoft.Research.Naiad.Frameworks.GraphLINQ
Assembly: Microsoft.Research.Naiad.GraphLINQ (in Microsoft.Research.Naiad.GraphLINQ.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax
C#
public static Stream<NodeWithValue<TOutput>, TTime> StateMachine<TValue, TState, TOutput, TTime>( this Stream<NodeWithValue<TValue>, TTime> nodes, Stream<NodeWithValue<TState>, TTime> initialStates, Func<TValue, TState, Pair<TState, TOutput>> transitionSelector, TState defaultState ) where TTime : Object, Time<TTime>
Parameters
- nodes
- Type: Microsoft.Research.NaiadStreamNodeWithValueTValue, TTime
The stream of nodes with values. - initialStates
- Type: Microsoft.Research.NaiadStreamNodeWithValueTState, TTime
The stream of initial states for each node. All initial states should exist at times no later than the first value. - transitionSelector
- Type: SystemFuncTValue, TState, PairTState, TOutput
A function from current value and state, to new state and output. - defaultState
- Type: TState
The default state associated with a node.
Type Parameters
- TValue
- The type of value associated with each node.
- TState
- The type of state associated with each node.
- TOutput
- The type of output produced by each node.
- TTime
- The type of timestamp on each record.
Return Value
Type: StreamNodeWithValueTOutput, TTimeThe stream of outputs produced by transitions.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type StreamNodeWithValueTValue, TTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).See Also