Changeset 5328
- Timestamp:
- 01/18/11 17:47:49 (14 years ago)
- Location:
- branches/HeuristicLab.MetaOptimization
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization.Views/3.3/MetaOptimizationProblemView.cs
r5313 r5328 56 56 private void createExperimentButton_Click(object sender, EventArgs e) { 57 57 if (Content != null) { 58 long count = Content.ParameterConfigurationTree.GetCombinationCount(); 58 long max = 100000; 59 long count = Content.ParameterConfigurationTree.GetCombinationCount(max); 59 60 60 61 System.Windows.Forms.DialogResult result = System.Windows.Forms.DialogResult.OK; 61 62 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 } 63 68 } 64 69 if (result == System.Windows.Forms.DialogResult.OK) { -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/ConstrainedTypeValue.cs
r5313 r5328 16 16 17 17 [Storable] 18 IEnumerable<Type> validTypes;18 private IEnumerable<Type> validTypes; 19 19 public IEnumerable<Type> ValidTypes { 20 20 get { return validTypes; } … … 49 49 50 50 public ConstrainedTypeValue() : base() { 51 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true) ;51 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList(); 52 52 this.Value = ValidTypes.First(); 53 53 } 54 54 public ConstrainedTypeValue(Type value) : base() { 55 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true) ;55 this.ValidTypes = ApplicationManager.Manager.GetTypes(typeof(T), true).ToList(); 56 56 this.Value = value; 57 57 } -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/ParameterConfigurationTree.cs
r5313 r5328 214 214 } 215 215 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) { 217 222 long cnt = 0; 218 223 foreach (var c in this) { 219 224 cnt++; 225 if (max > 0 && cnt >= max) { 226 return cnt; 227 } 220 228 } 221 229 return cnt; -
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/MetaOptimizationProblem.cs
r5313 r5328 40 40 public const string ProblemTypeParameterName = "ProblemType"; 41 41 public const string ProblemsParameterName = "Problems"; 42 public const string ParameterConfigurationTreeParameterName = "ParameterConfiguration Tree";42 public const string ParameterConfigurationTreeParameterName = "ParameterConfiguration"; 43 43 public const string RepetitionsParameterName = "Repetitions"; 44 44
Note: See TracChangeset
for help on using the changeset viewer.