Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4641


Ignore:
Timestamp:
10/23/10 04:07:18 (14 years ago)
Author:
swagner
Message:

Worked on allele frequency analysis (#1234)

Location:
trunk/sources
Files:
4 added
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/AlleleFrequencyCollectionView.Designer.cs

    r4639 r4641  
    6161      chartArea1.AxisX.IntervalAutoMode = System.Windows.Forms.DataVisualization.Charting.IntervalAutoMode.VariableCount;
    6262      chartArea1.AxisX.LabelAutoFitStyle = ((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles)((System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.IncreaseFont | System.Windows.Forms.DataVisualization.Charting.LabelAutoFitStyles.DecreaseFont)));
    63       chartArea1.AxisX.Title = "Alleles";
     63      chartArea1.AxisX.Title = "Allele Index";
    6464      chartArea1.AxisY.Maximum = 1D;
    6565      chartArea1.AxisY.Minimum = 0D;
    6666      chartArea1.AxisY.Title = "Relative Frequency";
    67       chartArea1.AxisY2.Title = "Average Solution Quality / Average Impact";
     67      chartArea1.AxisY2.Title = "Average Solution Quality";
    6868      chartArea1.CursorX.IsUserEnabled = true;
    6969      chartArea1.CursorX.IsUserSelectionEnabled = true;
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/AlleleFrequencyCollectionView.cs

    r4639 r4641  
    8383      qualities.YValueType = ChartValueType.Double;
    8484      qualities.YAxisType = AxisType.Secondary;
    85       qualities.ToolTip = "#VAL";
    8685      chart.Series.Add(qualities);
    8786
     
    9190      impacts.YValueType = ChartValueType.Double;
    9291      impacts.YAxisType = AxisType.Secondary;
    93       impacts.ToolTip = "#VAL";
    9492      chart.Series.Add(impacts);
     93      invisibleSeries.Add(impacts);
    9594    }
    9695
     
    106105      impacts.Points.Clear();
    107106
     107      if (!invisibleSeries.Contains(qualities) && !invisibleSeries.Contains(impacts))
     108        chart.ChartAreas["Default"].AxisY2.Title = "Average Solution Quality / Average Impact";
     109      else if (!invisibleSeries.Contains(qualities))
     110        chart.ChartAreas["Default"].AxisY2.Title = "Average Solution Quality";
     111      else if (!invisibleSeries.Contains(impacts))
     112        chart.ChartAreas["Default"].AxisY2.Title = "Average Impact";
     113
    108114      if (!invisibleSeries.Contains(bestKnown)) {
    109115        foreach (AlleleFrequency af in Content.Where(x => x.ContainedInBestKnownSolution).OrderBy(x => x.AverageImpact)) {
    110           bestKnown.Points.Add(CreateFrequencyDataPoint(index, af));
    111           if (!invisibleSeries.Contains(qualities)) qualities.Points.AddXY(index, af.AverageSolutionQuality);
    112           if (!invisibleSeries.Contains(impacts)) impacts.Points.AddXY(index, af.AverageImpact);
     116          bestKnown.Points.Add(CreateDataPoint(index, af.Frequency, af));
     117          if (!invisibleSeries.Contains(qualities)) qualities.Points.Add(CreateDataPoint(index, af.AverageSolutionQuality, af));
     118          if (!invisibleSeries.Contains(impacts)) impacts.Points.Add(CreateDataPoint(index, af.AverageImpact, af));
    113119          index++;
    114120        }
     
    116122      if (!invisibleSeries.Contains(others)) {
    117123        foreach (AlleleFrequency af in Content.Where(x => !x.ContainedInBestKnownSolution).OrderBy(x => x.AverageImpact)) {
    118           others.Points.Add(CreateFrequencyDataPoint(index, af));
    119           if (!invisibleSeries.Contains(qualities)) qualities.Points.AddXY(index, af.AverageSolutionQuality);
    120           if (!invisibleSeries.Contains(impacts)) impacts.Points.AddXY(index, af.AverageImpact);
     124          others.Points.Add(CreateDataPoint(index, af.Frequency, af));
     125          if (!invisibleSeries.Contains(qualities)) qualities.Points.Add(CreateDataPoint(index, af.AverageSolutionQuality, af));
     126          if (!invisibleSeries.Contains(impacts)) impacts.Points.Add(CreateDataPoint(index, af.AverageImpact, af));
    121127          index++;
    122128        }
     
    124130    }
    125131
    126     protected virtual DataPoint CreateFrequencyDataPoint(int index, AlleleFrequency af) {
     132    protected virtual DataPoint CreateDataPoint(int index, double value, AlleleFrequency af) {
    127133      string nl = Environment.NewLine;
    128 
    129       DataPoint p = new DataPoint(index, af.Frequency);
    130       p.AxisLabel = af.Id;
     134      DataPoint p = new DataPoint(index, value);
    131135      p.ToolTip = string.Format("Id: {0}" + nl +
    132136                                "Relative Frequency: {1}" + nl +
     
    136140                                "Contained in Best Solution: {5}",
    137141                                af.Id, af.Frequency, af.AverageSolutionQuality, af.AverageImpact, af.ContainedInBestKnownSolution, af.ContainedInBestSolution);
     142      p.IsEmpty = value == 0;
    138143      return p;
    139144    }
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj

    r4639 r4641  
    117117  <ItemGroup>
    118118    <None Include="HeuristicLabAnalysisViewsPlugin.cs.frame" />
    119     <Compile Include="AlleleFrequencyCollectionView.cs" />
     119    <Compile Include="AlleleFrequencyCollectionView.cs">
     120      <SubType>UserControl</SubType>
     121    </Compile>
    120122    <Compile Include="AlleleFrequencyCollectionView.Designer.cs">
    121123      <DependentUpon>AlleleFrequencyCollectionView.cs</DependentUpon>
     
    127129    <Compile Include="AlleleFrequencyView.Designer.cs">
    128130      <DependentUpon>AlleleFrequencyView.cs</DependentUpon>
     131    </Compile>
     132    <Compile Include="AlleleFrequencyCollectionHistoryView.cs">
     133      <SubType>UserControl</SubType>
     134    </Compile>
     135    <Compile Include="AlleleFrequencyCollectionHistoryView.Designer.cs">
     136      <DependentUpon>AlleleFrequencyCollectionHistoryView.cs</DependentUpon>
    129137    </Compile>
    130138    <Compile Include="Properties\AssemblyInfo.cs" />
  • trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalyzer.cs

    r4639 r4641  
    7070      Parameters.Add(new ValueParameter<BoolValue>("StoreAlleleFrequenciesHistory", "True if the history of all allele frequencies should be stored.", new BoolValue(false)));
    7171      Parameters.Add(new ValueParameter<IntValue>("UpdateInterval", "The interval in which the allele frequency analysis should be applied.", new IntValue(1)));
    72       Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the operator was called since the last update."));
     72      Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the operator was called since the last update.", "AlleleFrequencyAnalyzerUpdateCounter"));
    7373    }
    7474
    75     private class AlleleFrequencyEqualityComparer : IEqualityComparer<AlleleFrequency> {
     75    #region AlleleFrequencyIdEqualityComparer
     76    private class AlleleFrequencyIdEqualityComparer : IEqualityComparer<AlleleFrequency> {
    7677      public bool Equals(AlleleFrequency x, AlleleFrequency y) {
    7778        return x.Id == y.Id;
    7879      }
    7980      public int GetHashCode(AlleleFrequency obj) {
    80         return obj.GetHashCode();
     81        return obj.Id.GetHashCode();
    8182      }
    8283    }
     84    #endregion
    8385
    8486    public override IOperation Apply() {
     
    121123
    122124        // calculate dummy allele frequencies of alleles of best known solution which did not occur
    123         var bestKnownFrequencies = bestKnownAlleles.Select(x => new AlleleFrequency(x.Id, 0, x.Impact, 0, true, false)).Except(frequencies, new AlleleFrequencyEqualityComparer());
     125        var bestKnownFrequencies = bestKnownAlleles.Select(x => new AlleleFrequency(x.Id, 0, x.Impact, 0, true, false)).Except(frequencies, new AlleleFrequencyIdEqualityComparer());
    124126
    125127        // fetch results collection
     
    142144        if (storeHistory) {
    143145          if (!results.ContainsKey("Allele Frequencies History")) {
    144             AlleleFrequencyCollectionCollection history = new AlleleFrequencyCollectionCollection();
     146            AlleleFrequencyCollectionHistory history = new AlleleFrequencyCollectionHistory();
    145147            history.Add(frequenciesCollection);
    146148            results.Add(new Result("Allele Frequencies History", history));
    147149          } else {
    148             ((AlleleFrequencyCollectionCollection)results["Allele Frequencies History"].Value).Add(frequenciesCollection);
     150            ((AlleleFrequencyCollectionHistory)results["Allele Frequencies History"].Value).Add(frequenciesCollection);
    149151          }
    150152        }
  • trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyCollectionHistory.cs

    r4639 r4641  
    2626namespace HeuristicLab.Analysis {
    2727  /// <summary>
    28   /// Represents a collection of allele frequencies collections.
     28  /// Represents history values of allele frequencies collections.
    2929  /// </summary>
    30   [Item("AlleleFrequencyCollectionCollection", "Represents a collection of allele frequencies collections.")]
     30  [Item("AlleleFrequencyCollectionHistory", "Represents history values of allele frequencies collections.")]
    3131  [StorableClass]
    32   public class AlleleFrequencyCollectionCollection : ItemCollection<AlleleFrequencyCollection> {
    33     public AlleleFrequencyCollectionCollection() : base() { }
    34     public AlleleFrequencyCollectionCollection(IEnumerable<AlleleFrequencyCollection> collections) : base(new ItemCollection<AlleleFrequencyCollection>(collections)) { }
     32  public class AlleleFrequencyCollectionHistory : ItemCollection<AlleleFrequencyCollection> {
     33    public AlleleFrequencyCollectionHistory() : base() { }
     34    public AlleleFrequencyCollectionHistory(IEnumerable<AlleleFrequencyCollection> collections) : base(new ItemCollection<AlleleFrequencyCollection>(collections)) { }
    3535    [StorableConstructor]
    36     protected AlleleFrequencyCollectionCollection(bool deserializing) : base(deserializing) { }
     36    protected AlleleFrequencyCollectionHistory(bool deserializing) : base(deserializing) { }
    3737  }
    3838}
  • trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj

    r4639 r4641  
    111111    <None Include="HeuristicLabAnalysisPlugin.cs.frame" />
    112112    <Compile Include="AlleleFrequencyCollection.cs" />
     113    <Compile Include="AlleleFrequencyCollectionHistory.cs" />
    113114    <Compile Include="BestAverageWorstQualityAnalyzer.cs" />
    114115    <Compile Include="BestAverageWorstQualityCalculator.cs" />
     
    117118    <Compile Include="Allele.cs" />
    118119    <Compile Include="AlleleFrequency.cs" />
    119     <Compile Include="AlleleFrequencyCollectionCollection.cs" />
    120120    <Compile Include="QualityAnalyzer.cs" />
    121121    <Compile Include="MinAverageMaxValueAnalyzer.cs" />
  • trunk/sources/HeuristicLab.Analysis/3.3/MultiAnalyzer.cs

    r3664 r4641  
    5454      : base() {
    5555      Parameters.Add(new ValueLookupParameter<IntValue>("UpdateInterval", "The interval in which the contained analyzers should be applied.", new IntValue(1)));
    56       Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the MultiAnalyzer was called since the last update."));
     56      Parameters.Add(new LookupParameter<IntValue>("UpdateCounter", "The value which counts how many times the MultiAnalyzer was called since the last update.", "MultiAnalyzerUpdateCounter"));
    5757    }
    5858    [StorableConstructor]
  • trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj

    r4065 r4641  
    130130      <DependentUpon>CheckedItemListView.cs</DependentUpon>
    131131    </Compile>
     132    <Compile Include="MovieView.cs">
     133      <SubType>UserControl</SubType>
     134    </Compile>
     135    <Compile Include="MovieView.Designer.cs">
     136      <DependentUpon>MovieView.cs</DependentUpon>
     137    </Compile>
    132138    <Compile Include="LogView.cs">
    133139      <SubType>UserControl</SubType>
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs

    r4623 r4641  
    315315    }
    316316    private void ParameterizeAnalyzers() {
    317       BestTSPSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    318       BestTSPSolutionAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
    319       BestTSPSolutionAnalyzer.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
    320       BestTSPSolutionAnalyzer.ResultsParameter.ActualName = "Results";
    321       BestTSPSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
    322       BestTSPSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
    323       BestTSPSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
    324 
    325       TSPAlleleFrequencyAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
    326       TSPAlleleFrequencyAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
    327       TSPAlleleFrequencyAnalyzer.SolutionParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
    328       TSPAlleleFrequencyAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
    329       TSPAlleleFrequencyAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
    330       TSPAlleleFrequencyAnalyzer.ResultsParameter.ActualName = "Results";
     317      if (BestTSPSolutionAnalyzer != null) {
     318        BestTSPSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     319        BestTSPSolutionAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
     320        BestTSPSolutionAnalyzer.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
     321        BestTSPSolutionAnalyzer.ResultsParameter.ActualName = "Results";
     322        BestTSPSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
     323        BestTSPSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
     324        BestTSPSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
     325      }
     326
     327      if (TSPAlleleFrequencyAnalyzer != null) {
     328        TSPAlleleFrequencyAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;
     329        TSPAlleleFrequencyAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
     330        TSPAlleleFrequencyAnalyzer.SolutionParameter.ActualName = SolutionCreator.PermutationParameter.ActualName;
     331        TSPAlleleFrequencyAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
     332        TSPAlleleFrequencyAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
     333        TSPAlleleFrequencyAnalyzer.ResultsParameter.ActualName = "Results";
     334      }
    331335    }
    332336    private void ParameterizeOperators() {
Note: See TracChangeset for help on using the changeset viewer.