Beispiel #1
0
            /// <summary>
            /// Returns true if the other edge represents the same geographical information than this edge.
            /// </summary>
            /// <param name="other"></param>
            /// <returns></returns>
            public bool EqualsGeometrically(IGraphEdgeData other)
            {
                var otherResolved = (other as RouterResolvedGraphEdge);

                if (otherResolved != null)
                { // the same type already!
                    // only the coordinates can be different now.
                    if (this.Coordinates != null)
                    {     // both have to contain the same coordinates.
                        if (this.Coordinates.Length != otherResolved.Coordinates.Length)
                        { // impossible, different number of coordinates.
                            return(false);
                        }

                        for (int idx = 0; idx < otherResolved.Coordinates.Length; idx++)
                        {
                            if (this.Coordinates[idx].Longitude != otherResolved.Coordinates[idx].Longitude ||
                                this.Coordinates[idx].Latitude != otherResolved.Coordinates[idx].Latitude)
                            { // oeps, coordinates are different!
                                return(false);
                            }
                        }
                        return(true);
                    }
                    else
                    { // both are null.
                        return(otherResolved.Coordinates == null);
                    }
                }
                return(false);
            }
Beispiel #2
0
        /// <summary>
        /// Returns true if the given edge equals this edge.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(IGraphEdgeData other)
        {
            var otherEdge = (CHEdgeData)other;

            return(otherEdge._value == this._value &&
                   otherEdge._meta == this._meta &&
                   otherEdge.Weight == this.Weight);
        }
Beispiel #3
0
 /// <summary>
 /// Returns true if the other edge represents the same information than this edge.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(IGraphEdgeData other)
 {
     if (other is LiveEdge)
     { // ok, type is the same.
         var otherLive = (LiveEdge)other;
         if (otherLive._value != this._value)
         { // basic info different.
             return(false);
         }
         return(otherLive.Distance == this.Distance);
     }
     return(false);
 }
Beispiel #4
0
 /// <summary>
 /// Returns true if the given edge equals this edge.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(IGraphEdgeData other)
 {
     var otherEdge = (CHEdgeData)other;
     return (otherEdge._contractedDirection == this._contractedDirection &&
         otherEdge._value == this._value &&
         otherEdge.BackwardContractedId == this.BackwardContractedId &&
         otherEdge.BackwardWeight == this.BackwardWeight &&
         otherEdge.ForwardWeight == this.ForwardWeight &&
         otherEdge.ForwardContractedId == this.ForwardContractedId);
 }
Beispiel #5
0
 /// <summary>
 /// Returns true if the given edge equals this edge.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(IGraphEdgeData other)
 {
     var otherEdge = (CHEdgeData)other;
     return otherEdge._value == this._value &&
         otherEdge._meta == this._meta &&
         otherEdge.Weight == this.Weight;
 }
            /// <summary>
            /// Returns true if the other edge represents the same geographical information than this edge.
            /// </summary>
            /// <param name="other"></param>
            /// <returns></returns>
            public bool EqualsGeometrically(IGraphEdgeData other)
            {
                var otherResolved = (other as RouterResolvedGraphEdge);
                if (otherResolved != null)
                { // the same type already!
                    // only the coordinates can be different now.
                    if (this.Coordinates != null)
                    { // both have to contain the same coordinates.
                        if (this.Coordinates.Length != otherResolved.Coordinates.Length)
                        { // impossible, different number of coordinates.
                            return false;
                        }

                        for (int idx = 0; idx < otherResolved.Coordinates.Length; idx++)
                        {
                            if (this.Coordinates[idx].Longitude != otherResolved.Coordinates[idx].Longitude ||
                                this.Coordinates[idx].Latitude != otherResolved.Coordinates[idx].Latitude)
                            { // oeps, coordinates are different!
                                return false;
                            }
                        }
                        return true;
                    }
                    else
                    { // both are null.
                        return otherResolved.Coordinates == null;
                    }
                }
                return false;
            }
Beispiel #7
0
 /// <summary>
 /// Returns true if the other edge represents the same information than this edge.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(IGraphEdgeData other)
 {
     if (other is Edge)
     { // ok, type is the same.
         var otherEdge = (Edge)other;
         if (otherEdge._value != this._value)
         { // basic info different.
             return false;
         }
         return otherEdge.Distance == this.Distance;
     }
     return false;
 }
Beispiel #8
0
 /// <summary>
 /// Returns true if the other edge represents the same information than this edge.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(IGraphEdgeData other)
 {
     if (other is LiveEdge)
     { // ok, type is the same.
         var otherLive = (LiveEdge)other;
         if (otherLive._value != this._value)
         { // basic info different.
             return false;
         }
     }
     return false;
 }