Changeset 6978


Ignore:
Timestamp:
11/09/11 17:15:58 (8 years ago)
Author:
bburlacu
Message:

#1661: Added SymbolicExpressionTreeLengthAnalyzer. Added new scalingFactory visual property for table data rows (for dynamically adjusting the histogram scale depending on the number of bins) + scaling logic inside the tree length analyzer, adjusted DataTableView.

Location:
trunk/sources
Files:
1 added
4 edited

Legend:

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

    r6676 r6978  
    576576      }
    577577
    578       double current = minValue, intervalCenter = intervalWidth / 2.0;
     578      var area = chart.ChartAreas[0];
     579      double current = 0.0;
     580      if (!Double.IsNaN(Content.VisualProperties.XAxisMinimumFixedValue) && !Content.VisualProperties.XAxisMinimumAuto)
     581        current = Content.VisualProperties.XAxisMinimumFixedValue;
     582      else current = minValue;
     583
     584      area.AxisX.Interval = intervalWidth / row.VisualProperties.ScaleFactor;
     585      area.AxisX.IntervalOffset = intervalWidth / row.VisualProperties.ScaleFactor;
     586
     587      series.SetCustomProperty("PointWidth", intervalWidth.ToString());
     588
    579589      int frequency = 0;
    580       series.Points.AddXY(current - intervalCenter, 0); // so that the first column is not visually truncated
    581590      foreach (double v in row.Values.Where(x => !IsInvalidValue(x)).OrderBy(x => x)) {
    582591        while (v > current + intervalWidth) {
    583           series.Points.AddXY(current + intervalCenter, frequency);
     592          series.Points.AddXY(current + intervalWidth, frequency);
    584593          current += intervalWidth;
    585594          frequency = 0;
     
    587596        frequency++;
    588597      }
    589       series.Points.AddXY(current + intervalCenter, frequency);
    590       series.Points.AddXY(current + 3 * intervalCenter, 0); // so that the last column is not visually truncated
     598      series.Points.AddXY(current + intervalWidth, frequency);
    591599    }
    592600
  • trunk/sources/HeuristicLab.Analysis/3.3/DataVisualization/DataRowVisualProperties.cs

    r6676 r6978  
    142142      }
    143143    }
     144    private double scaleFactor;
     145    public double ScaleFactor {
     146      get { return scaleFactor; }
     147      set {
     148        if (scaleFactor != value) {
     149          scaleFactor = value;
     150          OnPropertyChanged("ScaleFactor");
     151        }
     152      }
     153    }
    144154    private string displayName;
    145155    public string DisplayName {
     
    203213      get { return exactBins; }
    204214      set { exactBins = value; }
     215    }
     216    [Storable(Name = "ScaleFactor")]
     217    private double StorableScaleFactor {
     218      get { return scaleFactor; }
     219      set { scaleFactor = value; }
    205220    }
    206221    [Storable(Name = "DisplayName")]
     
    224239      this.bins = original.bins;
    225240      this.exactBins = original.exactBins;
     241      this.scaleFactor = original.scaleFactor;
    226242      this.displayName = original.displayName;
    227243    }
     
    236252      bins = 10;
    237253      exactBins = false;
     254      scaleFactor = 1.0;
    238255      displayName = String.Empty;
    239256    }
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r6887 r6978  
    111111    <Compile Include="Analyzers\MinAverageMaxSymbolicExpressionTreeLengthAnalyzer.cs" />
    112112    <Compile Include="Analyzers\SymbolicExpressionSymbolFrequencyAnalyzer.cs" />
     113    <Compile Include="Analyzers\SymbolicExpressionTreeLengthAnalyzer.cs" />
    113114    <Compile Include="Analyzers\SymbolicExpressionTreeLengthCalculator.cs" />
    114115    <Compile Include="ArchitectureManipulators\ArgumentCreater.cs" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r6803 r6978  
    3636  [StorableClass]
    3737  public abstract class SymbolicDataAnalysisProblem<T, U, V> : HeuristicOptimizationProblem<U, V>, IDataAnalysisProblem<T>, ISymbolicDataAnalysisProblem, IStorableContent
    38     where T : class,IDataAnalysisProblemData
     38    where T : class, IDataAnalysisProblemData
    3939    where U : class, ISymbolicDataAnalysisEvaluator<T>
    4040    where V : class, ISymbolicDataAnalysisSolutionCreator {
     
    202202      Operators.Add(new SymbolicDataAnalysisVariableFrequencyAnalyzer());
    203203      Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
     204      Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
    204205      ParameterizeOperators();
    205206    }
Note: See TracChangeset for help on using the changeset viewer.