Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/16/13 13:13:41 (12 years ago)
Author:
spimming
Message:

#1888:

  • Merged revisions from trunk
Location:
branches/OaaS
Files:
11 edited
5 copied

Legend:

Unmodified
Added
Removed
  • branches/OaaS

  • branches/OaaS/HeuristicLab.Analysis

  • branches/OaaS/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalysis/AlleleFrequencyAnalyzer.cs

    r7259 r9363  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    8889    }
    8990
    90     #region AlleleFrequencyIdEqualityComparer
     91    #region Equality Comparers
     92    private class AlleleIdEqualityComparer : IEqualityComparer<Allele> {
     93      public bool Equals(Allele x, Allele y) {
     94        return x.Id == y.Id;
     95      }
     96      public int GetHashCode(Allele obj) {
     97        return obj.Id.GetHashCode();
     98      }
     99    }
    91100    private class AlleleFrequencyIdEqualityComparer : IEqualityComparer<AlleleFrequency> {
    92101      public bool Equals(AlleleFrequency x, AlleleFrequency y) {
     
    112121        bool max = MaximizationParameter.ActualValue.Value;
    113122        ItemArray<T> solutions = SolutionParameter.ActualValue;
    114         ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
     123        double[] qualities = QualityParameter.ActualValue.Select(x => x.Value).ToArray();
    115124        T bestKnownSolution = BestKnownSolutionParameter.ActualValue;
    116125        bool storeHistory = StoreHistoryParameter.Value.Value;
     
    120129        if (!max) {
    121130          bestIndex = qualities
    122             .Select((x, index) => new { index, x.Value })
     131            .Select((x, i) => new { Index = i, Value = x })
    123132            .OrderBy(x => x.Value)
    124             .First().index;
     133            .First().Index;
    125134        } else {
    126135          bestIndex = qualities
    127             .Select((x, index) => new { index, x.Value })
     136            .Select((x, i) => new { Index = i, Value = x })
    128137            .OrderByDescending(x => x.Value)
    129             .First().index;
     138            .First().Index;
    130139        }
    131140
     
    142151                                                          x.Count() / ((double)solutions.Length),
    143152                                                          x.Average(a => a.Allele.Impact),
    144                                                           x.Average(a => a.Quality.Value),
     153                                                          x.Average(a => a.Quality),
    145154                                                          bestKnownAlleles == null ? false : bestKnownAlleles.Any(a => a.Id == x.Key),
    146155                                                          bestAlleles.Any(a => a.Id == x.Key)));
     
    248257        else
    249258          ((DoubleValue)results["Lost Alleles of Best Known Solution"].Value).Value = lostRelevantAllelesCount;
     259
     260        // calculate contained alleles of best known solution and relative quality
     261        if (bestKnownAlleles != null) {
     262          double qualityRange = Math.Abs(qualities.Max() - qualities.Min());
     263          var points = solutions.Select((s, index) => new Point2D<double>(CalculateAlleles(s).Intersect(bestKnownAlleles, new AlleleIdEqualityComparer()).Count(),
     264                                                                          Math.Abs(qualities[index] - qualities[bestIndex]) / qualityRange));
     265          var avgContainedReleventAlleles = points.Select(x => x.X).Average();
     266
     267          var plot = new ScatterPlot("Contained Alleles of Best Known Solution and Relative Solution Qualtiy", null);
     268          plot.VisualProperties.XAxisTitle = "Contained Alleles of Best Known Solution";
     269          plot.VisualProperties.YAxisTitle = "Relative Solution Quality";
     270          plot.VisualProperties.XAxisMinimumAuto = false;
     271          plot.VisualProperties.XAxisMinimumFixedValue = 0.0;
     272          plot.VisualProperties.XAxisMaximumAuto = false;
     273          plot.VisualProperties.XAxisMaximumFixedValue = bestKnownAlleles.Length;
     274          plot.VisualProperties.YAxisMinimumAuto = false;
     275          plot.VisualProperties.YAxisMinimumFixedValue = 0.0;
     276          plot.VisualProperties.YAxisMaximumAuto = false;
     277          plot.VisualProperties.YAxisMaximumFixedValue = 1.0;
     278          var row = new ScatterPlotDataRow("Solutions of Current Generation", null, points);
     279          row.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;
     280          row.VisualProperties.PointSize = 5;
     281          plot.Rows.Add(row);
     282
     283          if (!results.ContainsKey("Scatter Plot"))
     284            results.Add(new Result("Scatter Plot", plot));
     285          else
     286            results["Scatter Plot"].Value = plot;
     287          if (storeHistory) {
     288            if (!results.ContainsKey("Scatter Plot History")) {
     289              results.Add(new Result("Scatter Plot History", new ScatterPlotHistory()));
     290            }
     291            ((ScatterPlotHistory)results["Scatter Plot History"].Value).Add(plot);
     292          }
     293
     294          if (!allelesTable.Rows.ContainsKey("Average Contained Alleles of Best Known Solution")) {
     295            allelesTable.Rows.Add(new DataRow("Average Contained Alleles of Best Known Solution", null));
     296            allelesTable.Rows["Average Contained Alleles of Best Known Solution"].VisualProperties.SecondYAxis = true;
     297            allelesTable.Rows["Average Contained Alleles of Best Known Solution"].VisualProperties.StartIndexZero = true;
     298          }
     299          allelesTable.Rows["Average Contained Alleles of Best Known Solution"].Values.Add(avgContainedReleventAlleles);
     300
     301          if (!results.ContainsKey("Average Contained Alleles of Best Known Solution"))
     302            results.Add(new Result("Average Contained Alleles of Best Known Solution", new DoubleValue(avgContainedReleventAlleles)));
     303          else
     304            ((DoubleValue)results["Average Contained Alleles of Best Known Solution"].Value).Value = avgContainedReleventAlleles;
     305        }
    250306      }
    251307      return base.Apply();
  • branches/OaaS/HeuristicLab.Analysis/3.3/DataVisualization/DataTable.cs

    r7259 r9363  
    5959    public NamedItemCollection<DataRow> Rows {
    6060      get { return rows; }
     61      private set {
     62        if (rows != null) throw new InvalidOperationException("Rows already set");
     63        rows = value;
     64        if (rows != null) RegisterRowsEvents();
     65      }
    6166    }
    6267
     
    7378    private IEnumerable<DataRow> StorableRows {
    7479      get { return rows; }
    75       set { rows = new NamedItemCollection<DataRow>(value); }
     80      set { Rows = new NamedItemCollection<DataRow>(value); }
    7681    }
    7782    #endregion
     
    8186    protected DataTable(DataTable original, Cloner cloner)
    8287      : base(original, cloner) {
    83       this.VisualProperties = (DataTableVisualProperties)cloner.Clone(original.visualProperties);
    84       this.rows = cloner.Clone(original.rows);
    85       this.RegisterRowsEvents();
     88      VisualProperties = (DataTableVisualProperties)cloner.Clone(original.visualProperties);
     89      Rows = cloner.Clone(original.rows);
    8690    }
    8791    public DataTable()
    8892      : base() {
    8993      VisualProperties = new DataTableVisualProperties();
    90       rows = new NamedItemCollection<DataRow>();
    91       this.RegisterRowsEvents();
     94      Rows = new NamedItemCollection<DataRow>();
    9295    }
    9396    public DataTable(string name)
    9497      : base(name) {
    9598      VisualProperties = new DataTableVisualProperties(name);
    96       rows = new NamedItemCollection<DataRow>();
    97       this.RegisterRowsEvents();
     99      Rows = new NamedItemCollection<DataRow>();
    98100    }
    99101    public DataTable(string name, string description)
    100102      : base(name, description) {
    101103      VisualProperties = new DataTableVisualProperties(name);
    102       rows = new NamedItemCollection<DataRow>();
    103       this.RegisterRowsEvents();
     104      Rows = new NamedItemCollection<DataRow>();
    104105    }
    105106
     
    217218    }
    218219    IEnumerable<string> IStringConvertibleMatrix.RowNames {
    219       get { return new List<string>(); }
     220      get { return Enumerable.Empty<string>(); }
    220221      set { throw new NotSupportedException(); }
    221222    }
  • branches/OaaS/HeuristicLab.Analysis/3.3/DataVisualization/DataTableVisualProperties.cs

    r7259 r9363  
    2020#endregion
    2121
     22using HeuristicLab.Common;
     23using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2224using System.ComponentModel;
    2325using System.Drawing;
    24 using HeuristicLab.Common;
    25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626
    2727namespace HeuristicLab.Analysis {
     
    315315    }
    316316
     317    private bool xAxisLogScale;
     318    public bool XAxisLogScale {
     319      get { return xAxisLogScale; }
     320      set {
     321        if (xAxisLogScale == value) return;
     322        xAxisLogScale = value;
     323        OnPropertyChanged("XAxisLogScale");
     324      }
     325    }
     326
     327    private bool secondXAxisLogScale;
     328    public bool SecondXAxisLogScale {
     329      get { return secondXAxisLogScale; }
     330      set {
     331        if (secondXAxisLogScale == value) return;
     332        secondXAxisLogScale = value;
     333        OnPropertyChanged("SecondXAxisLogScale");
     334      }
     335    }
     336
     337    private bool yAxisLogScale;
     338    public bool YAxisLogScale {
     339      get { return yAxisLogScale; }
     340      set {
     341        if (yAxisLogScale == value) return;
     342        yAxisLogScale = value;
     343        OnPropertyChanged("YAxisLogScale");
     344      }
     345    }
     346
     347    private bool secondYAxisLogScale;
     348    public bool SecondYAxisLogScale {
     349      get { return secondYAxisLogScale; }
     350      set {
     351        if (secondYAxisLogScale == value) return;
     352        secondYAxisLogScale = value;
     353        OnPropertyChanged("SecondYAxisLogScale");
     354      }
     355    }
     356
    317357    #region Persistence Properties
    318358    [Storable(Name = "TitleFont")]
     
    440480      get { return secondYAxisMaximumFixedValue; }
    441481      set { secondYAxisMaximumFixedValue = value; }
     482    }
     483    [Storable(Name = "XAxisLogScale")]
     484    private bool StorableXAxisLogScale {
     485      get { return xAxisLogScale; }
     486      set { xAxisLogScale = value; }
     487    }
     488    [Storable(Name = "SecondXAxisLogScale")]
     489    private bool StorableSecondXAxisLogScale {
     490      get { return secondXAxisLogScale; }
     491      set { secondXAxisLogScale = value; }
     492    }
     493    [Storable(Name = "YAxisLogScale")]
     494    private bool StorableYAxisLogScale {
     495      get { return yAxisLogScale; }
     496      set { yAxisLogScale = value; }
     497    }
     498    [Storable(Name = "SecondYAxisLogScale")]
     499    private bool StorableSecondYAxisLogScale {
     500      get { return secondYAxisLogScale; }
     501      set { secondYAxisLogScale = value; }
    442502    }
    443503    #endregion
     
    472532      this.secondYAxisMaximumAuto = original.secondYAxisMaximumAuto;
    473533      this.secondYAxisMaximumFixedValue = original.secondYAxisMaximumFixedValue;
     534      this.xAxisLogScale = original.xAxisLogScale;
     535      this.secondXAxisLogScale = original.secondXAxisLogScale;
     536      this.yAxisLogScale = original.yAxisLogScale;
     537      this.secondYAxisLogScale = original.secondYAxisLogScale;
    474538    }
    475539    public DataTableVisualProperties() {
     
    497561      this.secondYAxisMaximumAuto = true;
    498562      this.secondYAxisMaximumFixedValue = double.NaN;
     563      this.xAxisLogScale = false;
     564      this.secondXAxisLogScale = false;
     565      this.yAxisLogScale = false;
     566      this.secondYAxisLogScale = false;
    499567    }
    500568    public DataTableVisualProperties(string title)
     
    509577    public event PropertyChangedEventHandler PropertyChanged;
    510578    protected virtual void OnPropertyChanged(string propertyName) {
    511       PropertyChangedEventHandler handler = PropertyChanged;
     579      var handler = PropertyChanged;
    512580      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    513581    }
     
    547615        this.secondYAxisMaximumAuto = true;
    548616        this.secondYAxisMaximumFixedValue = double.NaN;
     617      }
    549618      #endregion
    550       }
    551619    }
    552620  }
  • branches/OaaS/HeuristicLab.Analysis/3.3/DataVisualization/ScatterPlot.cs

    r7829 r9363  
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.Drawing;
    2526using System.Linq;
     
    3839    }
    3940
    40     [Storable]
    41     private ObservableList<PointF> points;
    42     public ObservableList<PointF> Points {
    43       get { return points; }
    44     }
    45 
    46     [Storable]
    47     private string xAxisName;
    48     public string XAxisName {
    49       get { return xAxisName; }
     41    private ScatterPlotVisualProperties visualProperties;
     42    public ScatterPlotVisualProperties VisualProperties {
     43      get { return visualProperties; }
    5044      set {
    51         if (value == xAxisName) return;
    52         xAxisName = value;
    53         OnAxesNameChanged();
     45        if (visualProperties != value) {
     46          if (value == null) throw new ArgumentNullException("VisualProperties");
     47          if (visualProperties != null) visualProperties.PropertyChanged -= new PropertyChangedEventHandler(VisualProperties_PropertyChanged);
     48          visualProperties = value;
     49          visualProperties.PropertyChanged += new PropertyChangedEventHandler(VisualProperties_PropertyChanged);
     50          OnVisualPropertiesChanged();
     51        }
    5452      }
    5553    }
    5654
    57     [Storable]
    58     private string yAxisName;
    59     public string YAxisName {
    60       get { return yAxisName; }
     55    private NamedItemCollection<ScatterPlotDataRow> rows;
     56    public NamedItemCollection<ScatterPlotDataRow> Rows {
     57      get { return rows; }
     58      private set {
     59        if (rows != null) throw new InvalidOperationException("Rows already set");
     60        rows = value;
     61        if (rows != null) RegisterRowsEvents();
     62      }
     63    }
     64
     65    #region Persistence Properties
     66    [Storable(Name = "VisualProperties")]
     67    private ScatterPlotVisualProperties StorableVisualProperties {
     68      get { return visualProperties; }
    6169      set {
    62         if (value == yAxisName) return;
    63         yAxisName = value;
    64         OnAxesNameChanged();
     70        visualProperties = value;
     71        visualProperties.PropertyChanged += new PropertyChangedEventHandler(VisualProperties_PropertyChanged);
    6572      }
    6673    }
     74    [Storable(Name = "Rows")]
     75    private IEnumerable<ScatterPlotDataRow> StorableRows {
     76      get { return rows; }
     77      set { Rows = new NamedItemCollection<ScatterPlotDataRow>(value); }
     78    }
     79    #endregion
    6780
    6881    [StorableConstructor]
     
    7083    protected ScatterPlot(ScatterPlot original, Cloner cloner)
    7184      : base(original, cloner) {
    72       points = new ObservableList<PointF>(original.points);
    73       xAxisName = original.xAxisName;
    74       yAxisName = original.yAxisName;
     85      VisualProperties = cloner.Clone(original.visualProperties);
     86      Rows = cloner.Clone(original.rows);
    7587    }
    7688    public ScatterPlot()
    7789      : base() {
    78       this.points = new ObservableList<PointF>();
    79     }
    80     public ScatterPlot(string name)
    81       : base(name) {
    82       this.points = new ObservableList<PointF>();
     90      VisualProperties = new ScatterPlotVisualProperties();
     91      Rows = new NamedItemCollection<ScatterPlotDataRow>();
    8392    }
    8493    public ScatterPlot(string name, string description)
    8594      : base(name, description) {
    86       this.points = new ObservableList<PointF>();
    87     }
    88     public ScatterPlot(string name, string description, string xAxisName, string yAxisName)
     95      VisualProperties = new ScatterPlotVisualProperties(name);
     96      Rows = new NamedItemCollection<ScatterPlotDataRow>();
     97    }
     98    public ScatterPlot(string name, string description, ScatterPlotVisualProperties visualProperties)
    8999      : base(name, description) {
    90       this.points = new ObservableList<PointF>();
    91       this.xAxisName = xAxisName;
    92       this.yAxisName = yAxisName;
    93     }
    94     public ScatterPlot(IEnumerable<PointF> points)
    95       : base() {
    96       this.points = new ObservableList<PointF>(points);
    97     }
    98     public ScatterPlot(IEnumerable<PointF> points, string name)
    99       : base(name) {
    100       this.points = new ObservableList<PointF>(points);
    101     }
    102     public ScatterPlot(IEnumerable<PointF> points, string name, string description)
    103       : base(name, description) {
    104       this.points = new ObservableList<PointF>(points);
    105     }
    106     public ScatterPlot(IEnumerable<PointF> points, string name, string description, string xAxisName, string yAxisName)
    107       : base(name, description) {
    108       this.points = new ObservableList<PointF>(points);
    109       this.xAxisName = xAxisName;
    110       this.yAxisName = yAxisName;
    111     }
     100      VisualProperties = visualProperties;
     101      Rows = new NamedItemCollection<ScatterPlotDataRow>();
     102    }
     103
     104    // BackwardsCompatibility3.3
     105    #region Backwards compatible code, remove with 3.4
     106    private ObservableList<PointF> points;
     107    [Storable(Name = "points", AllowOneWay = true)]
     108    private ObservableList<PointF> StorablePoints {
     109      set { points = value; }
     110    }
     111    private string xAxisName;
     112    [Storable(Name = "xAxisName", AllowOneWay = true)]
     113    private string StorableXAxisName {
     114      set { xAxisName = value; }
     115    }
     116    private string yAxisName;
     117    [Storable(Name = "yAxisName", AllowOneWay = true)]
     118    private string StorableYAxisName {
     119      set { yAxisName = value; }
     120    }
     121    [StorableHook(HookType.AfterDeserialization)]
     122    private void AfterDeserialization() {
     123      if (VisualProperties == null) VisualProperties = new ScatterPlotVisualProperties(name);
     124      if (string.IsNullOrEmpty(VisualProperties.XAxisTitle) && !string.IsNullOrEmpty(xAxisName)) VisualProperties.XAxisTitle = xAxisName;
     125      if (string.IsNullOrEmpty(VisualProperties.YAxisTitle) && !string.IsNullOrEmpty(yAxisName)) VisualProperties.YAxisTitle = yAxisName;
     126      if (rows == null) Rows = new NamedItemCollection<ScatterPlotDataRow>();
     127      if ((Rows.Count == 0) && (points != null)) Rows.Add(new ScatterPlotDataRow(name, null, points.Select(p => new Point2D<double>(p.X, p.Y))));
     128    }
     129    #endregion
    112130
    113131    public override IDeepCloneable Clone(Cloner cloner) {
     
    115133    }
    116134
    117     public event EventHandler AxisNameChanged;
    118     protected virtual void OnAxesNameChanged() {
    119       EventHandler handler = AxisNameChanged;
    120       if (handler != null)
    121         handler(this, EventArgs.Empty);
     135    public event EventHandler VisualPropertiesChanged;
     136    protected virtual void OnVisualPropertiesChanged() {
     137      EventHandler handler = VisualPropertiesChanged;
     138      if (handler != null) handler(this, EventArgs.Empty);
     139    }
     140
     141    private void VisualProperties_PropertyChanged(object sender, PropertyChangedEventArgs e) {
     142      OnVisualPropertiesChanged();
     143    }
     144
     145    protected virtual void RegisterRowsEvents() {
     146      rows.ItemsAdded += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(rows_ItemsAdded);
     147      rows.ItemsRemoved += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(rows_ItemsRemoved);
     148      rows.ItemsReplaced += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(rows_ItemsReplaced);
     149      rows.CollectionReset += new CollectionItemsChangedEventHandler<ScatterPlotDataRow>(rows_CollectionReset);
     150    }
     151    private void rows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
     152      foreach (ScatterPlotDataRow row in e.Items)
     153        this.RegisterRowEvents(row);
     154
     155      this.OnColumnsChanged();
     156      this.OnColumnNamesChanged();
     157      this.OnReset();
     158    }
     159    private void rows_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
     160      foreach (ScatterPlotDataRow row in e.Items)
     161        this.DeregisterRowEvents(row);
     162
     163      this.OnColumnsChanged();
     164      this.OnColumnNamesChanged();
     165      this.OnReset();
     166    }
     167    private void rows_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
     168      foreach (ScatterPlotDataRow row in e.OldItems)
     169        this.DeregisterRowEvents(row);
     170      foreach (ScatterPlotDataRow row in e.Items)
     171        this.RegisterRowEvents(row);
     172
     173      this.OnColumnsChanged();
     174      this.OnColumnNamesChanged();
     175      this.OnReset();
     176    }
     177    private void rows_CollectionReset(object sender, CollectionItemsChangedEventArgs<ScatterPlotDataRow> e) {
     178      foreach (ScatterPlotDataRow row in e.OldItems)
     179        this.DeregisterRowEvents(row);
     180      foreach (ScatterPlotDataRow row in e.Items)
     181        this.RegisterRowEvents(row);
     182
     183      if (e.OldItems.Count() != e.Items.Count())
     184        this.OnColumnsChanged();
     185      this.OnColumnNamesChanged();
     186      this.OnReset();
     187    }
     188
     189    protected virtual void RegisterRowEvents(ScatterPlotDataRow row) {
     190      row.Points.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded);
     191      row.Points.ItemsMoved += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsMoved);
     192      row.Points.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved);
     193      row.Points.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced);
     194      row.Points.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset);
     195    }
     196    protected virtual void DeregisterRowEvents(ScatterPlotDataRow row) {
     197      row.Points.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsAdded);
     198      row.Points.ItemsMoved -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsMoved);
     199      row.Points.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsRemoved);
     200      row.Points.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_ItemsReplaced);
     201      row.Points.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<Point2D<double>>>(Points_CollectionReset);
     202    }
     203
     204    private void Points_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
     205      this.OnReset();
     206    }
     207    private void Points_ItemsMoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
     208      this.OnReset();
     209    }
     210    private void Points_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
     211      this.OnReset();
     212    }
     213    private void Points_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
     214      this.OnReset();
     215    }
     216    private void Points_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<Point2D<double>>> e) {
     217      this.OnReset();
    122218    }
    123219
    124220    #region IStringConvertibleMatrix Members
    125 
    126221    int IStringConvertibleMatrix.Rows {
    127       get { return points.Count; }
     222      get { return rows.Count == 0 ? 0 : rows.Max(r => r.Points.Count); }
    128223      set { throw new NotSupportedException(); }
    129224    }
    130225    int IStringConvertibleMatrix.Columns {
    131       get { return 2; }
     226      get { return rows.Count; }
    132227      set { throw new NotSupportedException(); }
    133228    }
    134229    IEnumerable<string> IStringConvertibleMatrix.ColumnNames {
    135       get { return new string[] { xAxisName, yAxisName }; }
     230      get { return rows.Select(r => r.Name); }
    136231      set { throw new NotSupportedException(); }
    137232    }
     
    142237
    143238    bool IStringConvertibleMatrix.SortableView {
    144       get { return false; }
     239      get { return true; }
    145240      set { throw new NotSupportedException(); }
    146241    }
     
    150245
    151246    string IStringConvertibleMatrix.GetValue(int rowIndex, int columnIndex) {
    152       if (rowIndex < points.Count && columnIndex < 2) {
    153         return columnIndex == 0 ? points[rowIndex].X.ToString() : points[rowIndex].Y.ToString();
     247      if (columnIndex < rows.Count) {
     248        string columnName = ((IStringConvertibleMatrix)this).ColumnNames.ElementAt(columnIndex);
     249        if (rows.ContainsKey(columnName) && rowIndex < rows[columnName].Points.Count)
     250          return string.Format("{0};{1}", rows[columnName].Points[rowIndex].X, rows[columnName].Points[rowIndex].Y);
    154251      }
    155252      return string.Empty;
  • branches/OaaS/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj

    r8016 r9363  
    9999  </PropertyGroup>
    100100  <ItemGroup>
    101     <Reference Include="ALGLIB-3.5.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    102       <HintPath>..\..\bin\ALGLIB-3.5.0.dll</HintPath>
     101    <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     102      <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath>
    103103      <Private>False</Private>
    104104    </Reference>
     
    125125    <Compile Include="AlleleFrequencyAnalysis\AlleleFrequencyCollectionHistory.cs" />
    126126    <Compile Include="BestScopeSolutionAnalyzer.cs" />
     127    <Compile Include="DataVisualization\ScatterPlotDataRowVisualProperties.cs" />
     128    <Compile Include="DataVisualization\ScatterPlotDataRow.cs" />
     129    <Compile Include="DataVisualization\ScatterPlotVisualProperties.cs" />
     130    <Compile Include="DataVisualization\ScatterPlotHistory.cs" />
    127131    <Compile Include="DataVisualization\DataRow.cs" />
    128132    <Compile Include="DataVisualization\DataRowVisualProperties.cs" />
     
    139143    <Compile Include="Plugin.cs" />
    140144    <Compile Include="PopulationDiversityAnalysis\PopulationDiversityAnalyzer.cs" />
     145    <Compile Include="PopulationDiversityAnalysis\SingleObjectivePopulationDiversityAnalyzer.cs" />
    141146    <Compile Include="QualityAnalysis\BestAverageWorstQualityAnalyzer.cs" />
    142147    <Compile Include="QualityAnalysis\BestAverageWorstQualityCalculator.cs" />
     
    240245  -->
    241246  <PropertyGroup>
    242     <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     247   <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    243248set ProjectDir=$(ProjectDir)
    244249set SolutionDir=$(SolutionDir)
     
    247252call PreBuildEvent.cmd
    248253</PreBuildEvent>
     254<PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     255export ProjectDir=$(ProjectDir)
     256export SolutionDir=$(SolutionDir)
     257
     258$SolutionDir/PreBuildEvent.sh
     259</PreBuildEvent>
    249260  </PropertyGroup>
    250261</Project>
  • branches/OaaS/HeuristicLab.Analysis/3.3/MultiObjective/ParetoFrontAnalyzer.cs

    r7172 r9363  
    1 using HeuristicLab.Common;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using HeuristicLab.Common;
    223using HeuristicLab.Core;
    324using HeuristicLab.Data;
  • branches/OaaS/HeuristicLab.Analysis/3.3/Plugin.cs.frame

    r7675 r9363  
    2626  /// Plugin class for HeuristicLab.Analysis plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Analysis", "3.3.6.$WCREV$")]
     28  [Plugin("HeuristicLab.Analysis", "3.3.7.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Analysis-3.3.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.ALGLIB", "3.5")]
     30  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
    3131  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3232  [PluginDependency("HeuristicLab.Common", "3.3")]
  • branches/OaaS/HeuristicLab.Analysis/3.3/PopulationDiversityAnalysis/PopulationDiversityAnalyzer.cs

    r7259 r9363  
    3131
    3232namespace HeuristicLab.Analysis {
     33  // use HeuristicLab.Analysis.SingleObjectivePopulationDiversityAnalyzer instead
     34  // BackwardsCompatibility3.3
     35  #region Backwards compatible code, remove with 3.4
    3336  /// <summary>
    3437  /// An operator for analyzing the solution diversity in a population.
    3538  /// </summary>
     39  [Obsolete]
    3640  [Item("PopulationDiversityAnalyzer", "An operator for analyzing the solution diversity in a population.")]
    3741  [StorableClass]
     
    245249    protected abstract double[,] CalculateSimilarities(T[] solutions);
    246250  }
     251  #endregion
    247252}
  • branches/OaaS/HeuristicLab.Analysis/3.3/Properties/AssemblyInfo.cs.frame

    r7259 r9363  
    5454// by using the '*' as shown below:
    5555[assembly: AssemblyVersion("3.3.0.0")]
    56 [assembly: AssemblyFileVersion("3.3.6.$WCREV$")]
     56[assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
Note: See TracChangeset for help on using the changeset viewer.