Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/12/22 14:49:45 (2 years ago)
Author:
pfleck
Message:

#3040 Added first version of SegmentOptimization Mutators.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SegmentOptimization/SegmentOptimizationProblem.cs

    r18098 r18186  
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
     31using HeuristicLab.PluginInfrastructure;
    3132using HeuristicLab.Problems.Instances;
    3233using HeuristicLab.Problems.Instances.Types;
     
    8182      });
    8283      #endregion
     84
     85      var optMutators = ApplicationManager.Manager.GetInstances<SegmentOptimizationMutator>();
     86      Encoding.ConfigureOperators(optMutators);
     87      Operators.AddRange(optMutators);
    8388    }
    8489    private SegmentOptimizationProblem(SegmentOptimizationProblem original, Cloner cloner)
     
    126131      var knownBounds = KnownBoundsParameter.Value;
    127132      var aggregation = aggregationParameter.Value.Value;
    128 
    129133      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) {
    130138      var bounds = new IntRange(solution.Min(), solution.Max());
    131 
    132139      double target = BoundedAggregation(data, knownBounds, aggregation);
    133140      double prediction = BoundedAggregation(data, bounds, aggregation);
    134 
    135141      return Math.Pow(target - prediction, 2);
    136142    }
Note: See TracChangeset for help on using the changeset viewer.