Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/17/11 19:17:51 (14 years ago)
Author:
cneumuel
Message:

#1215

  • changed AlgorithType and ProblemType to actually be types not objects. this eliminates redundant views for MetaOptimizationProblem
  • import algorithm for MetaOptimizationProblem
  • nicer dialog for combination creation
  • fixed iconimage for ParameterConfigurations
  • fixed ValidValues
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/MetaOptimizationProblemView.cs

    r5184 r5313  
    99using HeuristicLab.Optimization.Views;
    1010using HeuristicLab.Optimization;
     11using System.Windows.Forms;
    1112
    1213namespace HeuristicLab.Problems.MetaOptimization.Views {
     
    6263        }
    6364        if (result == System.Windows.Forms.DialogResult.OK) {
    64           Experiment experiment;
    65           if (Content.Repetitions.Value > 1) {
    66             experiment = Content.ParameterConfigurationTree.GenerateExperiment(Content.Algorithm, true, Content.Repetitions.Value);
    67           } else {
    68             experiment = Content.ParameterConfigurationTree.GenerateExperiment(Content.Algorithm);
     65          CreateExperimentDialog dlg = new CreateExperimentDialog();
     66          DialogResult dlgResult = dlg.ShowDialog();
     67
     68          if (dlgResult == DialogResult.OK) {
     69            EngineAlgorithm algorithm = Content.Algorithm;
     70            if(Content.Problems.Count > 0) algorithm.Problem = Content.Problems.First();
     71            Experiment experiment;
     72
     73            if (dlg.CreateBatchRuns) {
     74              experiment = Content.ParameterConfigurationTree.GenerateExperiment(algorithm, true, dlg.Repetitions);
     75            } else {
     76              experiment = Content.ParameterConfigurationTree.GenerateExperiment(algorithm);
     77            }
     78            MainFormManager.MainForm.ShowContent(experiment);
    6979          }
    70           MainFormManager.MainForm.ShowContent(experiment);
    7180        }
    7281      }
     
    7483
    7584    #endregion
     85
     86    protected void parameterCollectionView_DragEnterOver(object sender, System.Windows.Forms.DragEventArgs e) {
     87      e.Effect = DragDropEffects.None;
     88      Type type = e.Data.GetData("Type") as Type;
     89      if ((type != null) && (Content.AlgorithmType.ValidTypes.Contains(type))) {
     90        EngineAlgorithm algorithm = e.Data.GetData("Value") as EngineAlgorithm;
     91        if (algorithm.Problem == null || Content.ProblemType.ValidTypes.Contains(algorithm.Problem.GetType())) {
     92          e.Effect = DragDropEffects.Copy;
     93        }
     94      }
     95    }
     96    protected void parameterCollectionView_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) {
     97      if (e.Effect != DragDropEffects.None) {
     98        EngineAlgorithm algorithm = e.Data.GetData("Value") as EngineAlgorithm;
     99        Content.ImportAlgorithm(algorithm);
     100      }
     101    }
    76102  }
    77103}
Note: See TracChangeset for help on using the changeset viewer.