Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/02/14 15:08:32 (10 years ago)
Author:
ascheibe
Message:

#2127 merged r10213, r10433, r10476, r10494 into stable

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWREncoding.cs

    r9456 r11073  
    7575      return sb.ToString();
    7676    }
    77 
    78     public override bool Equals(object obj) {
    79       if (obj.GetType() == typeof(PWREncoding))
    80         return AreEqual(this, obj as PWREncoding);
    81       else
    82         return base.Equals(obj);
    83     }
    84 
    85     public override int GetHashCode() {
    86       if (PermutationWithRepetition.Length == 1)
    87         return PermutationWithRepetition[0].GetHashCode();
    88       if (PermutationWithRepetition.Length == 2)
    89         return PermutationWithRepetition[0].GetHashCode() ^ PermutationWithRepetition[1].GetHashCode();
    90       return 0;
    91     }
    92 
    93     private bool AreEqual(PWREncoding pWREncoding1, PWREncoding pWREncoding2) {
    94       if (pWREncoding1.PermutationWithRepetition.Length != pWREncoding2.PermutationWithRepetition.Length)
    95         return false;
    96       for (int i = 0; i < pWREncoding1.PermutationWithRepetition.Length; i++) {
    97         if (pWREncoding1.PermutationWithRepetition[i] != pWREncoding2.PermutationWithRepetition[i])
    98           return false;
    99       }
    100       return true;
    101     }
    10277  }
    10378}
Note: See TracChangeset for help on using the changeset viewer.