Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if Solution instances are equal
        /// </summary>
        /// <param name="input">Instance of Solution to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Solution input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Costs == input.Costs ||
                     (Costs != null &&
                      Costs.Equals(input.Costs))
                     ) &&
                 (
                     Distance == input.Distance ||
                     (Distance != null &&
                      Distance.Equals(input.Distance))
                 ) &&
                 (
                     Time == input.Time ||
                     (Time != null &&
                      Time.Equals(input.Time))
                 ) &&
                 (
                     TransportTime == input.TransportTime ||
                     (TransportTime != null &&
                      TransportTime.Equals(input.TransportTime))
                 ) &&
                 (
                     MaxOperationTime == input.MaxOperationTime ||
                     (MaxOperationTime != null &&
                      MaxOperationTime.Equals(input.MaxOperationTime))
                 ) &&
                 (
                     WaitingTime == input.WaitingTime ||
                     (WaitingTime != null &&
                      WaitingTime.Equals(input.WaitingTime))
                 ) &&
                 (
                     NoVehicles == input.NoVehicles ||
                     (NoVehicles != null &&
                      NoVehicles.Equals(input.NoVehicles))
                 ) &&
                 (
                     NoUnassigned == input.NoUnassigned ||
                     (NoUnassigned != null &&
                      NoUnassigned.Equals(input.NoUnassigned))
                 ) &&
                 (
                     Routes == input.Routes ||
                     Routes != null &&
                     Routes.SequenceEqual(input.Routes)
                 ) &&
                 (
                     Unassigned == input.Unassigned ||
                     (Unassigned != null &&
                      Unassigned.Equals(input.Unassigned))
                 ));
        }
        /// <summary>
        /// Returns true if Route instances are equal
        /// </summary>
        /// <param name="input">Instance of Route to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Route input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     VehicleId == input.VehicleId ||
                     (VehicleId != null &&
                      VehicleId.Equals(input.VehicleId))
                     ) &&
                 (
                     Distance == input.Distance ||
                     (Distance != null &&
                      Distance.Equals(input.Distance))
                 ) &&
                 (
                     TransportTime == input.TransportTime ||
                     (TransportTime != null &&
                      TransportTime.Equals(input.TransportTime))
                 ) &&
                 (
                     CompletionTime == input.CompletionTime ||
                     (CompletionTime != null &&
                      CompletionTime.Equals(input.CompletionTime))
                 ) &&
                 (
                     WaitingTime == input.WaitingTime ||
                     (WaitingTime != null &&
                      WaitingTime.Equals(input.WaitingTime))
                 ) &&
                 (
                     Activities == input.Activities ||
                     Activities != null &&
                     Activities.SequenceEqual(input.Activities)
                 ) &&
                 (
                     Points == input.Points ||
                     Points != null &&
                     Points.SequenceEqual(input.Points)
                 ));
        }