Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/02/13 13:15:07 (12 years ago)
Author:
ascheibe
Message:

#1886

  • changed duplicate solutions analyzer to also track avg. diversity as the standard diversity analyzer needs too much memory
  • fixed project references of eslGA
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DuplicateSolutionsAnalyzer.cs

    r8797 r9418  
    2121
    2222
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using HeuristicLab.Common;
     
    5960
    6061    [Storable]
    61     private DataTableHelper chartingHelper;
     62    private DataTableHelper chartingHelper, similarityChartHelper;
    6263    #endregion
    6364
     
    6869      : base(original, cloner) {
    6970      chartingHelper = (DataTableHelper)original.chartingHelper.Clone(cloner);
     71      similarityChartHelper = (DataTableHelper)original.similarityChartHelper.Clone(cloner);
    7072    }
    7173
     
    7779
    7880      chartingHelper = new DataTableHelper();
     81      similarityChartHelper = new DataTableHelper();
    7982    }
    8083
     
    8891      }
    8992      chartingHelper.InitializeChart(Results, "Duplicate Solutions", new string[] { "Duplicate Solutions per Generation" });
     93      similarityChartHelper.InitializeChart(Results, "Average Similarity", new string[] { "Avg. Similarity per Generation" });
    9094
    9195      var similarities = SimilarityCalculatorParameter.Value.CalculateSolutionCrowdSimilarity(ExecutionContext.Scope);
     96      List<double> similaritiesArr = new List<double>();
    9297      int counter = 0;
    9398      for (int i = 0; i < similarities.Length; i++) {
     
    98103          }
    99104        }
     105        for (int j = 0; j < similarities[i].Length; j++) {
     106          if (i != j) {
     107            similaritiesArr.Add(similarities[i][j]);
     108          }
     109        }
    100110      }
    101111
     112      similarityChartHelper.AddPoint(similaritiesArr.Average());
    102113      chartingHelper.AddPoint(counter / (double)similarities.Length);
    103114      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.