Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperiment.cs @ 12198

Last change on this file since 12198 was 12198, checked in by arapeanu, 9 years ago

#2288: Implemented Create Target Variation Experiment and added view skeleton for the variable interaction network

File size: 1.6 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Windows.Forms;
4using HeuristicLab.MainForm;
5using HeuristicLab.Optimization;
6using HeuristicLab.Optimizer;
7
8namespace HeuristicLab.VariableInteractionNetworks {
9  internal class CreateTargetVariationExperiment : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
10    public override string Name {
11      get { return "Create Target Variation &Experiment"; }
12    }
13    public override IEnumerable<string> Structure {
14      get { return new string[] { "&Edit" }; }
15    }
16    public override int Position {
17      get { return 2300; }
18    }
19    public override string ToolTipText {
20      get { return "Create an experiment for varying the target variable"; }
21    }
22
23    protected override void OnToolStripItemSet(EventArgs e) {
24      ToolStripItem.Enabled = false;
25    }
26    protected override void OnActiveViewChanged(object sender, EventArgs e) {
27      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
28      ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked;
29    }
30
31    public override void Execute() {
32      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
33      if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked)
34      {
35          var experiment = TargetVariation.CreateVariableCombinations((IAlgorithm) activeView.Content);
36          MainFormManager.MainForm.ShowContent(experiment);
37      }
38    }
39  }
40}
Note: See TracBrowser for help on using the repository browser.