- Timestamp:
- 08/09/11 11:01:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP.Grammar.Editor/HeuristicLab.Encodings.PermutationEncoding/3.3/Permutation.cs
r5445 r6647 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 36 37 public PermutationTypes PermutationType { 37 38 get { return permutationType; } 39 set { 40 bool changed = (permutationType != value); 41 permutationType = value; 42 if (changed) OnPermutationTypeChanged(); 43 } 38 44 } 39 45 … … 45 51 } 46 52 public Permutation() : this(PermutationTypes.RelativeUndirected) { } 47 public Permutation(PermutationTypes type) : base() { 53 public Permutation(PermutationTypes type) 54 : base() { 48 55 permutationType = type; 49 56 } … … 58 65 Randomize(random); 59 66 } 60 public Permutation(PermutationTypes type, int[] elements) : base(elements) { 67 public Permutation(PermutationTypes type, int[] elements) 68 : base(elements) { 61 69 permutationType = type; 62 70 } 63 public Permutation(PermutationTypes type, IntArray elements) : this(type, elements.Length) { 71 public Permutation(PermutationTypes type, IntArray elements) 72 : this(type, elements.Length) { 64 73 for (int i = 0; i < array.Length; i++) 65 74 array[i] = elements[i]; … … 111 120 return this[position]; 112 121 } 122 123 public event EventHandler PermutationTypeChanged; 124 125 protected virtual void OnPermutationTypeChanged() { 126 var handler = PermutationTypeChanged; 127 if (handler != null) handler(this, EventArgs.Empty); 128 } 113 129 } 114 130 }
Note: See TracChangeset
for help on using the changeset viewer.