Beispiel #1
0
 public void AddPath(NoteClass note, double value, bool isTwoway = false)
 {
     this.paths.Add(note, value);
     if (isTwoway)
     {
         note.paths.Add(this, value);
     }
 }
Beispiel #2
0
 public NoteClass(string id, NoteClass note, double value, bool isTwoway = false)
 {
     this.id = id;
     this.paths.Add(note, value);
     if (isTwoway) // 双向
     {
         note.paths.Add(this, value);
     }
 }
Beispiel #3
0
        public NoteClass GetShortestPath()
        {
            double    min         = 99999;
            NoteClass result_note = null;

            foreach (NoteClass note in this.paths.Keys)
            {
                if ((double)this.paths[note] < min)
                {
                    min         = (double)this.paths[note];
                    result_note = note;
                }
            }
            return(result_note);
        }
Beispiel #4
0
 public static string ShortestPathAnalysis(NoteClass[] notes, NoteClass fromNote, NoteClass toNote)
 {
     return("");
 }