Changeset 18186 for branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SegmentOptimization/SegmentOptimizationProblem.cs
- Timestamp:
- 01/12/22 14:49:45 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SegmentOptimization/SegmentOptimizationProblem.cs
r18098 r18186 29 29 using HeuristicLab.Optimization; 30 30 using HeuristicLab.Parameters; 31 using HeuristicLab.PluginInfrastructure; 31 32 using HeuristicLab.Problems.Instances; 32 33 using HeuristicLab.Problems.Instances.Types; … … 81 82 }); 82 83 #endregion 84 85 var optMutators = ApplicationManager.Manager.GetInstances<SegmentOptimizationMutator>(); 86 Encoding.ConfigureOperators(optMutators); 87 Operators.AddRange(optMutators); 83 88 } 84 89 private SegmentOptimizationProblem(SegmentOptimizationProblem original, Cloner cloner) … … 126 131 var knownBounds = KnownBoundsParameter.Value; 127 132 var aggregation = aggregationParameter.Value.Value; 128 129 133 var solution = individual.IntegerVector(Encoding.Name); 134 return Evaluate(solution, data, knownBounds, aggregation); 135 } 136 137 public static double Evaluate(IntegerVector solution, DoubleMatrix data, IntRange knownBounds, Aggregation aggregation) { 130 138 var bounds = new IntRange(solution.Min(), solution.Max()); 131 132 139 double target = BoundedAggregation(data, knownBounds, aggregation); 133 140 double prediction = BoundedAggregation(data, bounds, aggregation); 134 135 141 return Math.Pow(target - prediction, 2); 136 142 }
Note: See TracChangeset
for help on using the changeset viewer.