Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NetworkArc"/> class. Initializes a new arc defining information between 2 points.
 /// </summary>
 /// <param name="source">
 /// The source node of the arc. 
 /// </param>
 /// <param name="destination">
 /// The destination node of the arc. 
 /// </param>
 /// <param name="time">
 /// The total time of the arc. 
 /// </param>
 /// <param name="distance">
 /// The total distance in Km of the arc. 
 /// </param>
 /// <param name="departureTime">
 /// The departure time of this arc. Set to default(DateTime) if departure time is not relevant. 
 /// </param>
 /// <param name="transportMode">
 /// Sets the transport id used in the arc. 
 /// </param>
 public NetworkArc(
     INetworkNode source, 
     INetworkNode destination, 
     TransportTimeSpan time, 
     double distance, 
     DateTime departureTime, 
     string transportMode)
     : base((Location)source, (Location)destination, time, distance, departureTime, transportMode)
 {
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Arc"/> class. Initializes a new arc defining information between 2 points.
 /// </summary>
 /// <param name="source">
 /// The source location of the arc. 
 /// </param>
 /// <param name="destination">
 /// The destination location of the arc. 
 /// </param>
 /// <param name="time">
 /// The total time of the arc. 
 /// </param>
 /// <param name="distance">
 /// The total distance in Km of the arc. 
 /// </param>
 /// <param name="departureTime">
 /// The departure time of this arc. Set to default(DateTime) if departure time is not relevant. 
 /// </param>
 /// <param name="transportMode">
 /// Sets the transport id used in the arc. 
 /// </param>
 public Arc(
     Location source, 
     Location destination, 
     TransportTimeSpan time, 
     double distance, 
     DateTime departureTime, 
     string transportMode)
 {
     this.source = source;
     this.destination = destination;
     this.time = time;
     this.distance = distance;
     this.transportMode = transportMode;
     this.departureTime = departureTime;
 }
 /// <summary>
 /// Returns if the 2 TransportTimeSpan objects are equal.
 /// </summary>
 /// <param name="other">
 /// An TransportTimeSpan to compare to.
 /// </param>
 /// <returns>
 /// A boolean value.
 /// </returns>
 public bool Equals(TransportTimeSpan other)
 {
     return other.waitingTime.Equals(this.waitingTime) && other.travelTime.Equals(this.travelTime);
 }
 /// <summary>
 ///   The addition operator of the <see cref="TransportTimeSpan"/> class.
 /// </summary>
 /// <param name = "c1">
 ///   The first object to be added.
 /// </param>
 /// <param name = "c2">
 ///   The second object to be added.
 /// </param>
 /// <returns>
 /// The result of the addition.
 /// </returns>
 public static TransportTimeSpan operator +(TransportTimeSpan c1, TransportTimeSpan c2)
 {
     var output = new TransportTimeSpan
         {
            waitingTime = c1.waitingTime + c2.waitingTime, travelTime = c1.travelTime + c2.travelTime
         };
     return output;
 }