Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/28/14 19:12:39 (10 years ago)
Author:
bburlacu
Message:

#1837: Modified the SlidingWindowBestSolutionsCollection to use a dictionary for sliding window positions mapped to best solutions, because the last sliding window position before the algorithm reached its stop was not registered correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SlidingWindowBestSolutionsCollectionView.cs

    r10402 r10413  
    6464      var dataGridView = (DataGridView)sender;
    6565      var cell = dataGridView.SelectedCells[0];
    66       var bestSolutions = Content.BestSolutions.ToList();
     66      var bestSolutions = Content.BestSolutions.Values.ToList();
    6767      var tree = bestSolutions[cell.RowIndex];
    6868      var model = Content.CreateModel(tree, Content.Interpreter);
     
    115115
    116116    private void UpdateQualitiesMap() {
    117       var bestSolutions = Content.BestSolutions.ToList();
    118       var swPositions = Content.SlidingWindowPositions.ToList();
     117      var bestSolutions = Content.BestSolutions.Values.ToList();
     118      var swPositions = Content.BestSolutions.Keys.ToList();
    119119      var qualitiesMap = new DoubleMatrix(bestSolutions.Count, swPositions.Count + 1);
    120       qualitiesMap.ColumnNames = Content.SlidingWindowPositions.Select(x => x.Start + "-" + x.End).Concat(new List<string> { "Training" });
     120      qualitiesMap.ColumnNames = swPositions.Select(x => x.Item1 + "-" + x.Item2).Concat(new List<string> { "Training" });
    121121      qualitiesMap.RowNames = Enumerable.Range(1, bestSolutions.Count).Select(x => "M" + x);
    122122      double min = 0, max = 0;
     
    124124      for (int i = 0; i < qualitiesMap.Columns - 1; ++i) {
    125125        var pos = swPositions[i];
    126         var rows = Enumerable.Range(pos.Start, pos.End - pos.Start).ToList();
     126        var rows = Enumerable.Range(pos.Item1, pos.Item2 - pos.Item1).ToList();
    127127
    128128        for (int j = 0; j < qualitiesMap.Rows; ++j) {
Note: See TracChangeset for help on using the changeset viewer.