コード例 #1
0
ファイル: AStar.cs プロジェクト: TrurlMcByte/aa_glonass
 /// <summary>
 /// AStar Constructor.
 /// </summary>
 /// <param name="G">The graph on which AStar will perform the search.</param>
 public AStar(Graph G)
 {
     _Graph = G;
     _Open = new SortableList();
     _Closed = new SortableList();
     ChoosenHeuristic = EuclidianHeuristic;
     DijkstraHeuristicBalance = 0.5;
 }
コード例 #2
0
ファイル: GLONASS.cs プロジェクト: TrurlMcByte/aa_glonass
 /// <summary>
 /// reload db routes
 /// </summary>
 /// <param name="dbpath">string of path to gps database</param>
 public void LoadDataBase(string dbpath)
 {
     try {
         G = new Graph { };  // or do merge?
         this.LoadFromDb(dbpath);
     } catch (Exception eeee) { Err("Can't load paths " + eeee.Message); }
 }
コード例 #3
0
ファイル: Graph.cs プロジェクト: TrurlMcByte/aa_glonass
 /// <summary>
 /// Serialize Graph
 /// </summary>
 /// <param name="G">Graph</param>
 /// <param name="basefile">file name</param>
 public static void StoreToFile(Graph G, string basefile)
 {
     using (Stream StreamWrite = File.Create(basefile))
     {
         BinaryFormatter BinaryWrite = new BinaryFormatter();
         BinaryWrite.AssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple;
         BinaryWrite.Serialize(StreamWrite, G);
         StreamWrite.Close();
     }
 }