- Timestamp:
- 01/26/15 16:15:11 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/WeightedParentsDiversityComparator.cs
r11796 r11824 71 71 public ILookupParameter<IntValue> GenerationsParameter { 72 72 get { return (LookupParameter<IntValue>)Parameters["Generations"]; } 73 } 74 public ValueParameter<BoolValue> EnableDivCriteriaParameter { 75 get { return (ValueParameter<BoolValue>)Parameters["EnableDivCriteria"]; } 73 76 } 74 77 … … 114 117 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the population diversity analysis results should be stored.")); 115 118 Parameters.Add(new LookupParameter<IntValue>("Generations", "The current number of generations.")); 119 Parameters.Add(new ValueParameter<BoolValue>("EnableDivCriteria", "Use diversity as additional offspring selection criteria.", new BoolValue(true))); 116 120 117 121 foreach (IDiscreteDoubleValueModifier modifier in ApplicationManager.Manager.GetInstances<IDiscreteDoubleValueModifier>().OrderBy(x => x.Name)) … … 132 136 if (!Parameters.ContainsKey("Results")) 133 137 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the population diversity analysis results should be stored.")); 138 if (!Parameters.ContainsKey("EnableDivCriteria")) 139 Parameters.Add(new ValueParameter<BoolValue>("EnableDivCriteria", "Use diversity as additional offspring selection criteria.", new BoolValue(true))); 134 140 } 135 141 … … 203 209 bool result = maximization && leftQuality > threshold || !maximization && leftQuality < threshold; 204 210 211 //collect statistics 205 212 if (result) { 206 213 qualityCount++; 207 214 } 208 209 result = result && resultDiversity;210 211 215 if (resultDiversity) { 212 216 divCount++; 213 217 } 214 if (result ) {218 if (result && resultDiversity) { 215 219 successCount++; 216 220 } 217 221 overallCount++; 222 223 //use diveristiy criteria or not 224 if (EnableDivCriteriaParameter.Value.Value) { 225 result = result && resultDiversity; 226 } 218 227 219 228 BoolValue resultValue = ResultParameter.ActualValue;
Note: See TracChangeset
for help on using the changeset viewer.