Changeset 17773
- Timestamp:
- 10/08/20 15:39:46 (4 years ago)
- Location:
- branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/IABoundsEstimator.cs
r17768 r17773 474 474 var modelBound = Evaluate(instructions, ref instructionCounter, variableIntervals: occuringVariableRanges); 475 475 if (constraint.Interval.Contains(modelBound)) return 0.0; 476 return Math.Abs(modelBound.LowerBound - constraint.Interval.LowerBound) + 477 Math.Abs(modelBound.UpperBound - constraint.Interval.UpperBound); 476 477 478 var error = 0.0; 479 480 if (!constraint.Interval.Contains(modelBound.LowerBound)) { 481 error += Math.Abs(modelBound.LowerBound - constraint.Interval.LowerBound); 482 } 483 484 if (!constraint.Interval.Contains(modelBound.UpperBound)) { 485 error += Math.Abs(modelBound.UpperBound - constraint.Interval.UpperBound); 486 } 487 488 return error; 489 // return Math.Abs(modelBound.LowerBound - constraint.Interval.LowerBound) + 490 //Math.Abs(modelBound.UpperBound - constraint.Interval.UpperBound); 478 491 } 479 492 -
branches/3073_IA_constraint_splitting/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/IntervalUtil.cs
r17768 r17773 22 22 var regionRanges = new IntervalCollection(); 23 23 foreach (var kvp in variableRanges) { 24 if (kvp.Key != constraint.Target && constraint.Regions.GetReadonlyDictionary().TryGetValue(kvp.Key, out Intervalval)) {24 if (kvp.Key != constraint.Target && constraint.Regions.GetReadonlyDictionary().TryGetValue(kvp.Key, out var val)) { 25 25 regionRanges.AddInterval(kvp.Key, val); 26 26 } else { … … 80 80 IEnumerable<IntervalConstraint> constraints, IBoundsEstimator estimator, IntervalCollection intervalCollection, 81 81 ISymbolicExpressionTree solution) { 82 return constraints 83 .Select(constraint => IntervalConstraintViolation(constraint, estimator, intervalCollection, solution)) 84 .ToList(); 82 return constraints.Select(constraint => IntervalConstraintViolation(constraint, estimator, intervalCollection, solution)).ToList(); 85 83 } 86 84 }
Note: See TracChangeset
for help on using the changeset viewer.