Exemple #1
0
 /// <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;
 }
Exemple #2
0
 /// <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;
 }
        /// <summary>
        /// ICloneable implementation.
        /// Idem <see cref="ArrayList">ArrayList</see>
        /// </summary>
        /// <returns>Cloned object.</returns>
        public object Clone()
        {
            SortableList Clone = new SortableList(_Comparer, _List.Capacity);

            Clone._List          = (ArrayList)_List.Clone();
            Clone._AddDuplicates = _AddDuplicates;
            Clone._IsSorted      = _IsSorted;
            Clone._KeepSorted    = _KeepSorted;
            return(Clone);
        }
        /// <summary>
        /// Object.Equals() override.
        /// </summary>
        /// <returns>true if object is equal to this, otherwise false.</returns>
        public override bool Equals(object O)
        {
            SortableList SL = (SortableList)O;

            if (SL.Count != Count)
            {
                return(false);
            }
            for (int i = 0; i < Count; i++)
            {
                if (!SL[i].Equals(this[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
 /// <summary>
 /// ICloneable implementation.
 /// Idem <see cref="ArrayList">ArrayList</see>
 /// </summary>
 /// <returns>Cloned object.</returns>
 public object Clone()
 {
     SortableList Clone = new SortableList(_Comparer, _List.Capacity);
     Clone._List = (ArrayList)_List.Clone();
     Clone._AddDuplicates = _AddDuplicates;
     Clone._IsSorted = _IsSorted;
     Clone._KeepSorted = _KeepSorted;
     return Clone;
 }