Class StateGraphNode
A state graph node represents a unique state along with the set of step functions that can be applied to that state (if enabled). The state and set of step functions lead to a unique node fingerprint.
public class StateGraphNode
- Inheritance
-
StateGraphNode
- Inherited Members
Properties
Edges
Edges which lead to the outgoing set of state graph nodes.
public List<StateGraphEdge> Edges { get; set; }
Property Value
State
The system state represented by this node.
public IState State { get; set; }
Property Value
StepFunctions
The set of step functions that can be applied to this state. Once a step function is applied, it is consumed and not part of the updated state (though a step function can produce new step functions that are included in the step function list for the updated state).
public IList<IStepFunction> StepFunctions { get; set; }
Property Value
Methods
CreateCountBasedNodeLabelLambda()
This method creates a count based node label lambda, where it returns a a label with a monotonically increasing count each time it's called, so a sequence like N1, N2, N3, ... and so on.
public static Func<StateGraphNode, string> CreateCountBasedNodeLabelLambda()
Returns
DefaultNodeLabelLambda(StateGraphNode)
This method prints out the literal contents of the node in the state graph node.
public static string DefaultNodeLabelLambda(StateGraphNode node)
Parameters
nodeStateGraphNode
Returns
GenerateDotFileContent(StateGraphNode, Func<StateGraphNode, string>, bool)
This method generates a GraphViz dot file to help visualize the state graph.
public static string GenerateDotFileContent(StateGraphNode rootNode, Func<StateGraphNode, string> nodeLabelLambda = null, bool showStepFunctionsInNode = true)
Parameters
rootNodeStateGraphNodenodeLabelLambdaFunc<StateGraphNode, string>showStepFunctionsInNodebool
Returns
GenerateDotFileContent(Func<StateGraphNode, string>, bool)
public string GenerateDotFileContent(Func<StateGraphNode, string> nodeLabelLambda = null, bool showStepFunctionsInNode = true)
Parameters
nodeLabelLambdaFunc<StateGraphNode, string>showStepFunctionsInNodebool
Returns
GetNodeFingerprint()
Returns the node fingerprint which is a hash computed over the state hash along with the set of step functions that can be applied to this state (if enabled).
public string GetNodeFingerprint()
Returns
GetNodeFingerprint(IState, IList<IStepFunction>)
public static string GetNodeFingerprint(IState state, IList<IStepFunction> stepFunctions)
Parameters
stateIStatestepFunctionsIList<IStepFunction>