- Timestamp:
- 04/15/11 14:54:43 (14 years ago)
- Location:
- branches/histogram
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/histogram
- Property svn:mergeinfo changed
/trunk/sources (added) merged: 5962-5963,5971-5972,5975-5976,5983-5984,5987,5993,5997-5998,6002-6003,6009
- Property svn:mergeinfo changed
-
branches/histogram/HeuristicLab.Selection/3.3/NoSameMatesSelector.cs
r5957 r6011 1 1 using System; 2 using System.Collections.Generic; 2 3 using System.Linq; 3 using System.Collections.Generic;4 4 using System.Threading; 5 5 using HeuristicLab.Common; … … 55 55 [StorableConstructor] 56 56 protected NoSameMatesSelector(bool deserializing) : base(deserializing) { } 57 protected NoSameMatesSelector(NoSameMatesSelector original, Cloner cloner) : base(original, cloner) { 57 protected NoSameMatesSelector(NoSameMatesSelector original, Cloner cloner) 58 : base(original, cloner) { 58 59 RegisterParameterEventHandlers(); 59 60 } … … 62 63 } 63 64 64 public NoSameMatesSelector() : base() { 65 public NoSameMatesSelector() 66 : base() { 65 67 #region Create parameters 66 68 Parameters.Add(new ValueParameter<ISingleObjectiveSelector>(SelectorParameterName, "The inner selection operator to select the parents.", new TournamentSelector())); … … 85 87 Parameters.Add(new ValueParameter<ISingleObjectiveSelector>(SelectorParameterName, "The inner selection operator to select the parents.", selector)); 86 88 } 87 } 89 } 88 90 // FixedValueParameter for quality difference percentage, max attempts, use range 89 91 if (Parameters.ContainsKey(QualityDifferencePercentageParameterName)) { … … 153 155 ScopeList parents = CurrentScope.SubScopes[1].SubScopes; 154 156 155 for (int indexParent1 = 0, indexParent2 = 1; 156 indexParent1 < parents.Count - 1 && selectedParents < parentsToSelect - 1; 157 for (int indexParent1 = 0, indexParent2 = 1; 158 indexParent1 < parents.Count - 1 && selectedParents < parentsToSelect - 1; 157 159 indexParent1 += 2, indexParent2 += 2) { 158 160 double qualityParent1 = ((DoubleValue)parents[indexParent1].Variables[qualityName].Value).Value; … … 168 170 } 169 171 170 if (parentsDifferent) { 172 if (parentsDifferent) { 171 173 // inner selector already copied scopes, no cloning necessary here 172 174 selected[selectedParents++] = parents[indexParent1]; … … 204 206 if (CopySelected.Value != true) { 205 207 CopySelected.Value = true; 206 throw new ArgumentException(Name + ": CopySelected must always be true."); 207 } 208 } 209 #endregion 210 211 #region Helpers 208 } 209 } 210 #endregion 211 212 #region Helpers 212 213 private void ParameterizeSelector(ISingleObjectiveSelector selector) { 213 214 selector.CopySelected = new BoolValue(true); // must always be true
Note: See TracChangeset
for help on using the changeset viewer.