Exemplo n.º 1
0
 public double ProbabilityOf(MarkovNode <T> next)
 {
     if (Nexts.ContainsKey(next) == false)
     {
         throw new NotImplementedException("one next step only, more than one not implemented yet");
     }
     return(Nexts[next] * 1.0 / Occurrence);
 }
Exemplo n.º 2
0
        public MarkovNode <T> AddNext(MarkovNode <T> next)
        {
            if (Nexts.ContainsKey(next))
            {
                Nexts[next]++;
            }
            else
            {
                Nexts.Add(next, 1);
            }

            next.Occurrence++;

            return(this);
        }