예제 #1
0
 string FormatEdge(ViterbiNode from, ViterbiNode to)
 {
     if (BestPathMap.ContainsKey(GetNodeId(from)) && BestPathMap[GetNodeId(from)] == GetNodeId(to))
     {
         return(FormatEdge(from, to, "color=\"#40e050\" fontcolor=\"#40a050\" penwidth=3 fontsize=20 "));
     }
     else
     {
         return(FormatEdge(from, to, ""));
     }
 }
예제 #2
0
        void InitBestPathMap(List <ViterbiNode> bestPath)
        {
            BestPathMap.Clear();

            if (bestPath == null)
            {
                return;
            }

            for (var i = 0; i < bestPath.Count; i++)
            {
                var from = bestPath[i];
                var to   = bestPath[i + 1];

                var fromId = GetNodeId(from);
                var toId   = GetNodeId(to);

                BestPathMap.Add(fromId, toId);
            }
        }