コード例 #1
0
 private static double Heuristic(Node current, Node end, bool useActualLen)
 {
     if (useActualLen)
     {
         return(UtilityStuff.Dist(current, end));
     }
     else
     {
         return(1);
     }
 }
コード例 #2
0
 private static void CalculateScore(Node node, Node end)
 {
     Debug.WriteLine(node.Name + " dist|weight " + UtilityStuff.Dist(end, node) * 0.8f + " | " + (node.Weight * 0.6f));
     score[node.Name] = UtilityStuff.Dist(end, node) * 0.8f + (node.Weight * 0.6f);
 }
コード例 #3
0
        private void AddPath(object e)
        {
            ComboBox cb = (ComboBox)e;

            if (cb.SelectedIndex == -1)
            {
                return;
            }

            AddPath(UtilityStuff.IndexInGraph(selectedNode, graph), cb.SelectedIndex, isPathTwoWay, UtilityStuff.Dist(graph.TheGraph[UtilityStuff.IndexInGraph(selectedNode, graph)], Graph[cb.SelectedIndex]));
        }