Ejemplo n.º 1
0
 public override void AddEdge(IValuedEdgeBasics <Point> EdgeToPath)
 {
     if (_ListPathEdges.Count() == 0)
     {
         _ListPathEdges.Add(EdgeToPath);
         _ListPathPoints.Add(EdgeToPath.StartPoint);
         _ListPathPoints.Add(EdgeToPath.EndPoint);
     }
     else if (_ListPathEdges.Last().EndPoint == EdgeToPath.StartPoint)
     {
         _ListPathEdges.Add(EdgeToPath);
         _ListPathPoints.Add(EdgeToPath.EndPoint);
     }
     else
     {
         throw new Exception("Edge does not continue the path");
     }
 }
Ejemplo n.º 2
0
 public bool Equals(IValuedEdgeBasics <Point> edge1, IValuedEdgeBasics <Point> edge2)
 {
     if (edge2 == null && edge1 == null)
     {
         return(true);
     }
     else if (edge1 == null | edge2 == null)
     {
         return(false);
     }
     //else if (edge1.Name == edge2.Name)
     //    return true;
     else if (edge1.StartPoint.Equals(edge2.StartPoint) &&
              edge1.EndPoint.Equals(edge2.EndPoint) &&
              edge1.EdgeValue == edge2.EdgeValue)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 public int GetHashCode(IValuedEdgeBasics <Point> obj)
 {
     return(0);
     //return (String.Concat(obj.StartPoint.ID, obj.EndPoint.ID)).GetHashCode();
 }
Ejemplo n.º 4
0
 public int CompareTo(IValuedEdgeBasics <PointType> other)
 {
     return(this.EdgeValue.CompareTo(other.EdgeValue));
 }
Ejemplo n.º 5
0
        public bool Equals(IValuedEdgeBasics <PointType> other)
        {
            DirectedValuedEdgeEqualityComparer defaultComparer = new DirectedValuedEdgeEqualityComparer();

            return(defaultComparer.Equals(this, other));
        }