Beispiel #1
0
        public void AddConnection(MarkovNode <TNodeType> connectionTarget, double connectionWeight)
        {
            var newConnection = new MarkovConnection <TNodeType>
            {
                Target = connectionTarget,
                Weight = connectionWeight
            };

            _connections.Add(newConnection);
        }
Beispiel #2
0
 public TNodeType NextValue(TNodeType nodeSource)
 {
     _currentNode = _possibleNodes.FirstOrDefault(node => node.NodeValue.Equals(nodeSource));
     return(NextValue());
 }
Beispiel #3
0
 public MarkovChain(List <MarkovNode <TNodeType> > possibleNodes)
 {
     _currentNode = PickRandomNode(possibleNodes);
 }
Beispiel #4
0
 public TNodeType NextValue()
 {
     _currentNode = _currentNode.GetNextNode();
     return(_currentNode.NodeValue);
 }
Beispiel #5
0
 public MarkovChain(List <MarkovNode <TNodeType> > possibleNodes, MarkovNode <TNodeType> startNode)
 {
     _possibleNodes = possibleNodes;
     _currentNode   = startNode;
 }