Changeset 5522 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/IntValueRange.cs
- Timestamp:
- 02/21/11 00:46:33 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/RangeConstraints/IntValueRange.cs
r5337 r5522 47 47 return solutions; 48 48 } 49 50 protected override double CalculateSimilarityValue(IntValue a, IntValue b) { 51 double range = UpperBound.Value - LowerBound.Value; 52 double diff = Math.Abs(a.Value - b.Value); 53 return Math.Max(0, (range - (diff * 2)) / range); 54 } 49 55 } 50 56 }
Note: See TracChangeset
for help on using the changeset viewer.