Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/07/12 16:50:35 (13 years ago)
Author:
sforsten
Message:

#1776:

  • selection of a voting strategy is now possible
  • a more sophisticated strategy as discussed with gkronber will be implemented soon
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs

    r7259 r7464  
    2020#endregion
    2121
     22using System.Linq;
    2223using System.Windows.Forms;
     24using HeuristicLab.Common;
    2325using HeuristicLab.Core;
    2426using HeuristicLab.MainForm;
     27using HeuristicLab.PluginInfrastructure;
     28using HeuristicLab.Problems.DataAnalysis.Interfaces.Classification;
    2529
    2630namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    3741    }
    3842
     43    protected override void SetEnabledStateOfControls() {
     44      base.SetEnabledStateOfControls();
     45      cmbWeightCalculator.Enabled = !Locked && !ReadOnly && Content != null;
     46    }
     47
    3948    protected override void OnContentChanged() {
    4049      base.OnContentChanged();
    4150      itemsListView.Items.Remove(itemsListView.FindItemWithText("Model: ClassificationEnsembleModel"));
     51      if (cmbWeightCalculator.Items.Count == 0) {
     52        cmbWeightCalculator.Items.AddRange(ApplicationManager.Manager.GetInstances<IClassificationEnsembleSolutionWeightCalculator>().OrderBy(b => b.Name, new NaturalStringComparer()).ToArray());
     53        if (cmbWeightCalculator.Items.Count > 0)
     54          cmbWeightCalculator.SelectedIndex = 0;
     55      } else {
     56        Content.WeightCalculator = (IClassificationEnsembleSolutionWeightCalculator)cmbWeightCalculator.SelectedItem;
     57      }
     58    }
     59
     60    private void cmbWeightCalculator_SelectedIndexChanged(object sender, System.EventArgs e) {
     61      if (cmbWeightCalculator.SelectedItem != null)
     62        Content.WeightCalculator = (IClassificationEnsembleSolutionWeightCalculator)cmbWeightCalculator.SelectedItem;
    4263    }
    4364
Note: See TracChangeset for help on using the changeset viewer.