public void AddConnection(MarkovNode <TNodeType> connectionTarget, double connectionWeight) { var newConnection = new MarkovConnection <TNodeType> { Target = connectionTarget, Weight = connectionWeight }; _connections.Add(newConnection); }
public TNodeType NextValue(TNodeType nodeSource) { _currentNode = _possibleNodes.FirstOrDefault(node => node.NodeValue.Equals(nodeSource)); return(NextValue()); }
public MarkovChain(List <MarkovNode <TNodeType> > possibleNodes) { _currentNode = PickRandomNode(possibleNodes); }
public TNodeType NextValue() { _currentNode = _currentNode.GetNextNode(); return(_currentNode.NodeValue); }
public MarkovChain(List <MarkovNode <TNodeType> > possibleNodes, MarkovNode <TNodeType> startNode) { _possibleNodes = possibleNodes; _currentNode = startNode; }