Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5328


Ignore:
Timestamp:
01/18/11 17:47:49 (13 years ago)
Author:
cneumuel
Message:

#1215

  • minor fixes
Location:
branches/HeuristicLab.MetaOptimization
Files:
4 edited

Legend:

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

    r5313 r5328  
    5656    private void createExperimentButton_Click(object sender, EventArgs e) {
    5757      if (Content != null) {
    58         long count = Content.ParameterConfigurationTree.GetCombinationCount();
     58        long max = 100000;
     59        long count = Content.ParameterConfigurationTree.GetCombinationCount(max);
    5960
    6061        System.Windows.Forms.DialogResult result = System.Windows.Forms.DialogResult.OK;
    6162        if (count > 512) {
    62           result = System.Windows.Forms.MessageBox.Show(string.Format("Do you really want to create {0} optimizers? Be aware that this might take a significant amount of time and memory.", count), "Create Experiment", System.Windows.Forms.MessageBoxButtons.OKCancel);
     63          if (count == max) {
     64            result = System.Windows.Forms.MessageBox.Show(string.Format("Do you really want to create more than {0}+ optimizers? Be aware that this might take a significant amount of time and memory.", count), "Create Experiment", System.Windows.Forms.MessageBoxButtons.OKCancel);
     65          } else {
     66            result = System.Windows.Forms.MessageBox.Show(string.Format("Do you really want to create {0} optimizers? Be aware that this might take a significant amount of time and memory.", count), "Create Experiment", System.Windows.Forms.MessageBoxButtons.OKCancel);
     67          }
    6368        }
    6469        if (result == System.Windows.Forms.DialogResult.OK) {
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/ConstrainedTypeValue.cs

    r5313 r5328  
    1616
    1717    [Storable]
    18     IEnumerable<Type> validTypes;
     18    private IEnumerable<Type> validTypes;
    1919    public IEnumerable<Type> ValidTypes {
    2020      get { return validTypes; }
     
    4949
    5050    public ConstrainedTypeValue() : base() {
    51       this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true);
     51      this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList();
    5252      this.Value = ValidTypes.First();
    5353    }
    5454    public ConstrainedTypeValue(Type value) : base() {
    55       this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true);
     55      this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList();
    5656      this.Value = value;
    5757    }
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs

    r5313 r5328  
    214214    }
    215215
    216     public long GetCombinationCount() {
     216    /// <summary>
     217    /// returns the number of possible parameter combinations
     218    /// </summary>
     219    /// <param name="max">algorithm stops counting when max is reached. zero for infinite counting</param>
     220    /// <returns></returns>
     221    public long GetCombinationCount(long max) {
    217222      long cnt = 0;
    218223      foreach (var c in this) {
    219224        cnt++;
     225        if (max > 0 && cnt >= max) {
     226          return cnt;
     227        }
    220228      }
    221229      return cnt;
  • branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/MetaOptimizationProblem.cs

    r5313 r5328  
    4040    public const string ProblemTypeParameterName = "ProblemType";
    4141    public const string ProblemsParameterName = "Problems";
    42     public const string ParameterConfigurationTreeParameterName = "ParameterConfigurationTree";
     42    public const string ParameterConfigurationTreeParameterName = "ParameterConfiguration";
    4343    public const string RepetitionsParameterName = "Repetitions";
    4444
Note: See TracChangeset for help on using the changeset viewer.