- Timestamp:
- 08/14/10 18:31:09 (14 years ago)
- Location:
- trunk/tools/Templates
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/Templates/HeuristicLab.VS2010Wizards.Test/Program.cs
r4181 r4214 13 13 Application.EnableVisualStyles(); 14 14 Application.SetCompatibleTextRenderingDefault(false); 15 Application.Run(new AlgorithmWizardForm());15 Application.Run(new ProblemWizardForm()); 16 16 } 17 17 } -
trunk/tools/Templates/HeuristicLab.VS2010Wizards/ParametersControl.Designer.cs
r4188 r4214 158 158 "Lookup", 159 159 "ValueLookup", 160 "OptionalValue", 161 "ConstrainedValue", 162 "OptionalConstrainedValue", 160 163 "ScopeTreeLookup"}); 161 164 this.parameterTypeComboBox.Location = new System.Drawing.Point(3, 232); -
trunk/tools/Templates/HeuristicLab.VS2010Wizards/ProblemWizard.cs
r4188 r4214 49 49 replacementsDictionary.Add("$problemName$", form.ProblemName); 50 50 replacementsDictionary.Add("$problemDescription$", form.ProblemDescription); 51 replacementsDictionary.Add("$problemType $", ((form.IsMultiObjective) ? ("Multi") : ("Single")));52 replacementsDictionary.Add("$ maximizationParameterProperty$", "TODO");53 replacementsDictionary.Add("$ solutionCreatorParameterProperty$", "TODO");54 replacementsDictionary.Add("$ evaluatorParameterProperty$", "TODO");51 replacementsDictionary.Add("$problemTypeImplementation$", form.ProblemTypeImplementation); 52 replacementsDictionary.Add("$problemSpecificParameterProperties$", form.ProblemSpecificParameterProperties); 53 replacementsDictionary.Add("$problemSpecificProperties$", form.ProblemSpecificProperties); 54 replacementsDictionary.Add("$problemSpecificParameterInitializers$", form.ProblemSpecificParameterInitializers); 55 55 replacementsDictionary.Add("$parameterProperties$", form.ParameterProperties); 56 56 replacementsDictionary.Add("$properties$", form.Properties); -
trunk/tools/Templates/HeuristicLab.VS2010Wizards/ProblemWizardForm.Designer.cs
r4188 r4214 28 28 this.label2 = new System.Windows.Forms.Label(); 29 29 this.problemDescriptionTextBox = new System.Windows.Forms.TextBox(); 30 this. isMultiObjectiveCheckBox = new System.Windows.Forms.CheckBox();30 this.multiObjectiveCheckBox = new System.Windows.Forms.CheckBox(); 31 31 this.problemNameTextBox = new System.Windows.Forms.TextBox(); 32 32 this.cancelButton = new System.Windows.Forms.Button(); … … 37 37 this.page2Panel = new System.Windows.Forms.Panel(); 38 38 this.label3 = new System.Windows.Forms.Label(); 39 this.parametersControl = new HeuristicLab.VS2010Wizards.ParametersControl();40 39 this.panel2 = new System.Windows.Forms.Panel(); 41 40 this.nextButton = new System.Windows.Forms.Button(); 42 41 this.previousButton = new System.Windows.Forms.Button(); 43 42 this.page1Panel = new System.Windows.Forms.Panel(); 43 this.singleObjectiveCheckBox = new System.Windows.Forms.CheckBox(); 44 this.contentPanel = new System.Windows.Forms.Panel(); 45 this.solutionCreatorTypeTextBox = new System.Windows.Forms.TextBox(); 46 this.evaluatorTypeTextBox = new System.Windows.Forms.TextBox(); 47 this.label6 = new System.Windows.Forms.Label(); 48 this.label5 = new System.Windows.Forms.Label(); 49 this.parametersControl = new HeuristicLab.VS2010Wizards.ParametersControl(); 44 50 this.panel1.SuspendLayout(); 45 51 ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); 46 52 this.page2Panel.SuspendLayout(); 47 53 this.page1Panel.SuspendLayout(); 54 this.contentPanel.SuspendLayout(); 48 55 this.SuspendLayout(); 49 56 // … … 52 59 this.label1.Anchor = System.Windows.Forms.AnchorStyles.None; 53 60 this.label1.AutoSize = true; 54 this.label1.Location = new System.Drawing.Point(100, 48);61 this.label1.Location = new System.Drawing.Point(100, 19); 55 62 this.label1.Name = "label1"; 56 63 this.label1.Size = new System.Drawing.Size(38, 13); … … 62 69 this.label2.Anchor = System.Windows.Forms.AnchorStyles.None; 63 70 this.label2.AutoSize = true; 64 this.label2.Location = new System.Drawing.Point(100, 96);71 this.label2.Location = new System.Drawing.Point(100, 67); 65 72 this.label2.Name = "label2"; 66 73 this.label2.Size = new System.Drawing.Size(63, 13); … … 71 78 // 72 79 this.problemDescriptionTextBox.Anchor = System.Windows.Forms.AnchorStyles.None; 73 this.problemDescriptionTextBox.Location = new System.Drawing.Point(10 2, 112);80 this.problemDescriptionTextBox.Location = new System.Drawing.Point(103, 83); 74 81 this.problemDescriptionTextBox.Multiline = true; 75 82 this.problemDescriptionTextBox.Name = "problemDescriptionTextBox"; 76 this.problemDescriptionTextBox.Size = new System.Drawing.Size(46 9, 63);83 this.problemDescriptionTextBox.Size = new System.Drawing.Size(468, 63); 77 84 this.problemDescriptionTextBox.TabIndex = 3; 78 85 // 79 // isMultiObjectiveCheckBox 80 // 81 this.isMultiObjectiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.None; 82 this.isMultiObjectiveCheckBox.AutoSize = true; 83 this.isMultiObjectiveCheckBox.Location = new System.Drawing.Point(102, 188); 84 this.isMultiObjectiveCheckBox.Name = "isMultiObjectiveCheckBox"; 85 this.isMultiObjectiveCheckBox.Size = new System.Drawing.Size(96, 17); 86 this.isMultiObjectiveCheckBox.TabIndex = 5; 87 this.isMultiObjectiveCheckBox.Text = "Multi-Objective"; 88 this.isMultiObjectiveCheckBox.UseVisualStyleBackColor = true; 86 // multiObjectiveCheckBox 87 // 88 this.multiObjectiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.None; 89 this.multiObjectiveCheckBox.AutoSize = true; 90 this.multiObjectiveCheckBox.Location = new System.Drawing.Point(212, 152); 91 this.multiObjectiveCheckBox.Name = "multiObjectiveCheckBox"; 92 this.multiObjectiveCheckBox.Size = new System.Drawing.Size(96, 17); 93 this.multiObjectiveCheckBox.TabIndex = 5; 94 this.multiObjectiveCheckBox.Text = "Multi-Objective"; 95 this.multiObjectiveCheckBox.UseVisualStyleBackColor = true; 96 this.multiObjectiveCheckBox.CheckedChanged += new System.EventHandler(this.multiObjectiveCheckBox_CheckedChanged); 89 97 // 90 98 // problemNameTextBox 91 99 // 92 100 this.problemNameTextBox.Anchor = System.Windows.Forms.AnchorStyles.None; 93 this.problemNameTextBox.Location = new System.Drawing.Point(103, 64);101 this.problemNameTextBox.Location = new System.Drawing.Point(103, 35); 94 102 this.problemNameTextBox.Name = "problemNameTextBox"; 95 103 this.problemNameTextBox.Size = new System.Drawing.Size(468, 20); … … 152 160 // page2Panel 153 161 // 154 this.page2Panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)155 | System.Windows.Forms.AnchorStyles.Left)156 | System.Windows.Forms.AnchorStyles.Right)));157 162 this.page2Panel.Controls.Add(this.label3); 158 163 this.page2Panel.Controls.Add(this.parametersControl); 159 this.page2Panel.Location = new System.Drawing.Point(0, 86); 164 this.page2Panel.Dock = System.Windows.Forms.DockStyle.Fill; 165 this.page2Panel.Location = new System.Drawing.Point(0, 0); 160 166 this.page2Panel.Name = "page2Panel"; 161 this.page2Panel.Size = new System.Drawing.Size(676, 2 89);167 this.page2Panel.Size = new System.Drawing.Size(676, 293); 162 168 this.page2Panel.TabIndex = 10; 163 169 this.page2Panel.Visible = false; … … 171 177 this.label3.TabIndex = 1; 172 178 this.label3.Text = "Parameters:"; 173 //174 // parametersControl175 //176 this.parametersControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)177 | System.Windows.Forms.AnchorStyles.Left)178 | System.Windows.Forms.AnchorStyles.Right)));179 this.parametersControl.Location = new System.Drawing.Point(0, 33);180 this.parametersControl.Name = "parametersControl";181 this.parametersControl.Size = new System.Drawing.Size(676, 256);182 this.parametersControl.TabIndex = 0;183 179 // 184 180 // panel2 … … 218 214 // page1Panel 219 215 // 220 this.page1Panel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 221 | System.Windows.Forms.AnchorStyles.Left) 222 | System.Windows.Forms.AnchorStyles.Right))); 216 this.page1Panel.Controls.Add(this.solutionCreatorTypeTextBox); 217 this.page1Panel.Controls.Add(this.evaluatorTypeTextBox); 218 this.page1Panel.Controls.Add(this.label6); 219 this.page1Panel.Controls.Add(this.label5); 223 220 this.page1Panel.Controls.Add(this.label1); 224 221 this.page1Panel.Controls.Add(this.label2); 225 222 this.page1Panel.Controls.Add(this.problemDescriptionTextBox); 226 223 this.page1Panel.Controls.Add(this.problemNameTextBox); 227 this.page1Panel.Controls.Add(this.isMultiObjectiveCheckBox); 228 this.page1Panel.Location = new System.Drawing.Point(0, 86); 224 this.page1Panel.Controls.Add(this.singleObjectiveCheckBox); 225 this.page1Panel.Controls.Add(this.multiObjectiveCheckBox); 226 this.page1Panel.Dock = System.Windows.Forms.DockStyle.Fill; 227 this.page1Panel.Location = new System.Drawing.Point(0, 0); 229 228 this.page1Panel.Name = "page1Panel"; 230 this.page1Panel.Size = new System.Drawing.Size(676, 29 8);229 this.page1Panel.Size = new System.Drawing.Size(676, 293); 231 230 this.page1Panel.TabIndex = 9; 231 // 232 // singleObjectiveCheckBox 233 // 234 this.singleObjectiveCheckBox.Anchor = System.Windows.Forms.AnchorStyles.None; 235 this.singleObjectiveCheckBox.AutoSize = true; 236 this.singleObjectiveCheckBox.Checked = true; 237 this.singleObjectiveCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 238 this.singleObjectiveCheckBox.Location = new System.Drawing.Point(103, 152); 239 this.singleObjectiveCheckBox.Name = "singleObjectiveCheckBox"; 240 this.singleObjectiveCheckBox.Size = new System.Drawing.Size(103, 17); 241 this.singleObjectiveCheckBox.TabIndex = 5; 242 this.singleObjectiveCheckBox.Text = "Single-Objective"; 243 this.singleObjectiveCheckBox.UseVisualStyleBackColor = true; 244 this.singleObjectiveCheckBox.CheckedChanged += new System.EventHandler(this.singleObjectiveCheckBox_CheckedChanged); 245 // 246 // contentPanel 247 // 248 this.contentPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 249 | System.Windows.Forms.AnchorStyles.Left) 250 | System.Windows.Forms.AnchorStyles.Right))); 251 this.contentPanel.Controls.Add(this.page1Panel); 252 this.contentPanel.Controls.Add(this.page2Panel); 253 this.contentPanel.Location = new System.Drawing.Point(0, 85); 254 this.contentPanel.Name = "contentPanel"; 255 this.contentPanel.Size = new System.Drawing.Size(676, 293); 256 this.contentPanel.TabIndex = 11; 257 // 258 // solutionCreatorTypeTextBox 259 // 260 this.solutionCreatorTypeTextBox.Anchor = System.Windows.Forms.AnchorStyles.None; 261 this.solutionCreatorTypeTextBox.Location = new System.Drawing.Point(103, 236); 262 this.solutionCreatorTypeTextBox.Name = "solutionCreatorTypeTextBox"; 263 this.solutionCreatorTypeTextBox.Size = new System.Drawing.Size(468, 20); 264 this.solutionCreatorTypeTextBox.TabIndex = 8; 265 this.solutionCreatorTypeTextBox.Text = "IMyProblemSolutionCreator"; 266 this.solutionCreatorTypeTextBox.TextChanged += new System.EventHandler(this.solutionCreatorTypeTextBox_TextChanged); 267 // 268 // evaluatorTypeTextBox 269 // 270 this.evaluatorTypeTextBox.Anchor = System.Windows.Forms.AnchorStyles.None; 271 this.evaluatorTypeTextBox.Location = new System.Drawing.Point(103, 197); 272 this.evaluatorTypeTextBox.Name = "evaluatorTypeTextBox"; 273 this.evaluatorTypeTextBox.Size = new System.Drawing.Size(468, 20); 274 this.evaluatorTypeTextBox.TabIndex = 9; 275 this.evaluatorTypeTextBox.Text = "IMyProblemEvaluator"; 276 this.evaluatorTypeTextBox.TextChanged += new System.EventHandler(this.evaluatorTypeTextBox_TextChanged); 277 // 278 // label6 279 // 280 this.label6.Anchor = System.Windows.Forms.AnchorStyles.None; 281 this.label6.AutoSize = true; 282 this.label6.Location = new System.Drawing.Point(100, 220); 283 this.label6.Name = "label6"; 284 this.label6.Size = new System.Drawing.Size(112, 13); 285 this.label6.TabIndex = 6; 286 this.label6.Text = "Solution Creator Type:"; 287 // 288 // label5 289 // 290 this.label5.Anchor = System.Windows.Forms.AnchorStyles.None; 291 this.label5.AutoSize = true; 292 this.label5.Location = new System.Drawing.Point(100, 181); 293 this.label5.Name = "label5"; 294 this.label5.Size = new System.Drawing.Size(82, 13); 295 this.label5.TabIndex = 7; 296 this.label5.Text = "Evaluator Type:"; 297 // 298 // parametersControl 299 // 300 this.parametersControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 301 | System.Windows.Forms.AnchorStyles.Left) 302 | System.Windows.Forms.AnchorStyles.Right))); 303 this.parametersControl.Location = new System.Drawing.Point(0, 33); 304 this.parametersControl.Name = "parametersControl"; 305 this.parametersControl.Size = new System.Drawing.Size(676, 260); 306 this.parametersControl.TabIndex = 0; 232 307 // 233 308 // ProblemWizardForm … … 236 311 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 237 312 this.ClientSize = new System.Drawing.Size(676, 428); 313 this.Controls.Add(this.contentPanel); 238 314 this.Controls.Add(this.panel1); 239 315 this.Controls.Add(this.cancelButton); … … 242 318 this.Controls.Add(this.finishButton); 243 319 this.Controls.Add(this.panel2); 244 this.Controls.Add(this.page2Panel);245 this.Controls.Add(this.page1Panel);246 320 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 247 321 this.Name = "ProblemWizardForm"; … … 254 328 this.page1Panel.ResumeLayout(false); 255 329 this.page1Panel.PerformLayout(); 330 this.contentPanel.ResumeLayout(false); 256 331 this.ResumeLayout(false); 257 332 … … 263 338 private System.Windows.Forms.Label label2; 264 339 private System.Windows.Forms.TextBox problemDescriptionTextBox; 265 private System.Windows.Forms.CheckBox isMultiObjectiveCheckBox;340 private System.Windows.Forms.CheckBox multiObjectiveCheckBox; 266 341 private System.Windows.Forms.TextBox problemNameTextBox; 267 342 private System.Windows.Forms.Button cancelButton; … … 277 352 private ParametersControl parametersControl; 278 353 private System.Windows.Forms.Label label3; 354 private System.Windows.Forms.CheckBox singleObjectiveCheckBox; 355 private System.Windows.Forms.Panel contentPanel; 356 private System.Windows.Forms.TextBox solutionCreatorTypeTextBox; 357 private System.Windows.Forms.TextBox evaluatorTypeTextBox; 358 private System.Windows.Forms.Label label6; 359 private System.Windows.Forms.Label label5; 279 360 } 280 361 } -
trunk/tools/Templates/HeuristicLab.VS2010Wizards/ProblemWizardForm.cs
r4188 r4214 18 18 private set; 19 19 } 20 public bool IsSingleObjective { 21 get; 22 private set; 23 } 20 24 public bool IsMultiObjective { 21 25 get; … … 31 35 } 32 36 public string ParameterInitializers { 37 get; 38 private set; 39 } 40 public string EvaluatorType { 41 get; 42 private set; 43 } 44 public string SolutionCreatorType { 45 get; 46 private set; 47 } 48 public string ProblemTypeImplementation { 49 get; 50 private set; 51 } 52 public string ProblemSpecificParameterProperties { 53 get; 54 private set; 55 } 56 public string ProblemSpecificProperties { 57 get; 58 private set; 59 } 60 public string ProblemSpecificParameterInitializers { 33 61 get; 34 62 private set; … … 37 65 public ProblemWizardForm() { 38 66 InitializeComponent(); 67 IsSingleObjective = singleObjectiveCheckBox.Checked; 68 IsMultiObjective = multiObjectiveCheckBox.Checked; 69 EvaluatorType = evaluatorTypeTextBox.Text; 70 SolutionCreatorType = solutionCreatorTypeTextBox.Text; 39 71 } 40 72 … … 53 85 ProblemName = problemNameTextBox.Text; 54 86 ProblemDescription = problemDescriptionTextBox.Text; 55 IsMultiObjective = isMultiObjectiveCheckBox.Checked;56 ParameterProperties = parametersControl.GetParameterProperties("p rivate");87 IsMultiObjective = multiObjectiveCheckBox.Checked; 88 ParameterProperties = parametersControl.GetParameterProperties("public"); 57 89 Properties = parametersControl.GetProperties("public"); 58 90 ParameterInitializers = parametersControl.GetInitializers(); 91 92 if (IsMultiObjective && IsSingleObjective) { 93 ProblemTypeImplementation = "ISingleObjectiveProblem, IMultiObjectiveProblem"; 94 } else if (IsMultiObjective) { 95 ProblemTypeImplementation = "IMultiObjectiveProblem"; 96 } else if (IsSingleObjective) 97 ProblemTypeImplementation = "ISingleObjectiveProblem"; 98 99 ProblemSpecificParameterProperties = GetParamProps(); 100 ProblemSpecificProperties = GetProps(); 101 ProblemSpecificParameterInitializers = GetParamInitializers(); 102 } 103 104 private string GetParamProps() { 105 StringBuilder builder = new StringBuilder(); 106 if (IsSingleObjective) { 107 builder.Append(@"public OptionalValueParameter<DoubleValue> BestKnownQualityParameter { 108 get { return (OptionalValueParameter<DoubleValue>)Parameters[""BestKnownQuality""]; } 109 } 110 IParameter ISingleObjectiveProblem.BestKnownQualityParameter { 111 get { return BestKnownQualityParameter; } 112 }"); 113 builder.Append(Environment.NewLine); 114 builder.Append(@"public ValueParameter<BoolValue> MaximizationParameter { 115 get { return (ValueParameter<BoolValue>)Parameters[""Maximization""]; } 116 } 117 IParameter ISingleObjectiveProblem.MaximizationParameter { 118 get { return MaximizationParameter; } 119 }"); 120 builder.Append(Environment.NewLine); 121 } 122 if (IsMultiObjective) { 123 builder.Append(@" public ValueParameter<BoolArray> MultiObjectiveMaximizationParameter { 124 get { return (ValueParameter<BoolArray>)Parameters[""MultiObjectiveMaximization""]; } 125 } 126 IParameter IMultiObjectiveProblem.MaximizationParameter { 127 get { return MultiObjectiveMaximizationParameter; } 128 }"); 129 builder.Append(Environment.NewLine); 130 } 131 builder.Append(@"public ValueParameter<" + SolutionCreatorType + @"> SolutionCreatorParameter { 132 get { return (ValueParameter<" + SolutionCreatorType + @">)Parameters[""SolutionCreator""]; } 133 } 134 IParameter IProblem.SolutionCreatorParameter { 135 get { return SolutionCreatorParameter; } 136 } 137 public ValueParameter<" + EvaluatorType + @"> EvaluatorParameter { 138 get { return (ValueParameter<" + EvaluatorType + @">)Parameters[""Evaluator""]; } 139 } 140 IParameter IProblem.EvaluatorParameter { 141 get { return EvaluatorParameter; } 142 }"); 143 return builder.ToString(); 144 } 145 146 private string GetProps() { 147 StringBuilder builder = new StringBuilder(); 148 builder.Append(@"public " + SolutionCreatorType + @" SolutionCreator { 149 get { return SolutionCreatorParameter.Value; } 150 set { SolutionCreatorParameter.Value = value; } 151 } 152 ISolutionCreator IProblem.SolutionCreator { 153 get { return SolutionCreatorParameter.Value; } 154 } 155 public " + EvaluatorType + @" Evaluator { 156 get { return EvaluatorParameter.Value; } 157 set { EvaluatorParameter.Value = value; } 158 }"); 159 builder.Append(Environment.NewLine); 160 if (IsSingleObjective) { 161 builder.Append(@"ISingleObjectiveEvaluator ISingleObjectiveProblem.Evaluator { 162 get { return EvaluatorParameter.Value; } 163 }"); 164 builder.Append(Environment.NewLine); 165 } 166 if (IsMultiObjective) { 167 builder.Append(@"IMultiObjectiveEvaluator IMultiObjectiveProblem.Evaluator { 168 get { return EvaluatorParameter.Value; } 169 }"); 170 builder.Append(Environment.NewLine); 171 } 172 builder.Append(@"IEvaluator IProblem.Evaluator { 173 get { return EvaluatorParameter.Value; } 174 }"); 175 builder.Append(Environment.NewLine); 176 if (IsSingleObjective) { 177 builder.Append(@"public DoubleValue BestKnownQuality { 178 get { return BestKnownQualityParameter.Value; } 179 set { BestKnownQualityParameter.Value = value; } 180 }"); 181 builder.Append(Environment.NewLine); 182 } 183 return builder.ToString(); 184 } 185 186 private string GetParamInitializers() { 187 StringBuilder builder = new StringBuilder(); 188 if (IsSingleObjective) { 189 builder.Append(@"Parameters.Add(new ValueParameter<BoolValue>(""Maximization"", ""TODO: Set to the false for minimization, true for maximization and add a description."", new BoolValue(false)));"); 190 builder.Append(Environment.NewLine); 191 } 192 if (IsMultiObjective) { 193 builder.Append("// TODO: Change the default value to the number of objectives." + Environment.NewLine); 194 builder.Append(@"Parameters.Add(new ValueParameter<BoolArray>(""MultiObjectiveMaximization"", ""Set to false as the error of the regression model should be minimized."", new BoolArray(new bool[] {false, false})));"); 195 builder.Append(Environment.NewLine); 196 } 197 builder.Append("// TODO: Add a default solution creator." + Environment.NewLine); 198 builder.Append("Parameters.Add(new ValueParameter<" + SolutionCreatorType + ">(\"SolutionCreator\", \"The operator which should be used to create new solutions.\", null));"); 199 builder.Append(Environment.NewLine); 200 builder.Append("//TODO: Add a default evaluator." + Environment.NewLine); 201 builder.Append("Parameters.Add(new ValueParameter<" + EvaluatorType + ">(\"Evaluator\", \"The operator which should be used to evaluate solutions.\", null));"); 202 builder.Append(Environment.NewLine); 203 if (IsSingleObjective) { 204 builder.Append("Parameters.Add(new OptionalValueParameter<DoubleValue>(\"BestKnownQuality\", \"The quality of the best known solution.\"));"); 205 builder.Append(Environment.NewLine); 206 } 207 return builder.ToString(); 59 208 } 60 209 … … 72 221 nextButton.Enabled = true; 73 222 } 223 224 private void singleObjectiveCheckBox_CheckedChanged(object sender, EventArgs e) { 225 IsSingleObjective = singleObjectiveCheckBox.Checked; 226 nextButton.Enabled = IsSingleObjective || IsMultiObjective; 227 finishButton.Enabled = nextButton.Enabled; 228 } 229 private void multiObjectiveCheckBox_CheckedChanged(object sender, EventArgs e) { 230 IsMultiObjective = multiObjectiveCheckBox.Checked; 231 nextButton.Enabled = IsSingleObjective || IsMultiObjective; 232 finishButton.Enabled = nextButton.Enabled; 233 } 234 private void problemNameTextBox_TextChanged(object sender, EventArgs e) { 235 ProblemName = problemNameTextBox.Text.Trim(); 236 nextButton.Enabled = ProblemName != string.Empty; 237 } 238 private void evaluatorTypeTextBox_TextChanged(object sender, EventArgs e) { 239 EvaluatorType = evaluatorTypeTextBox.Text.Trim(); 240 nextButton.Enabled = EvaluatorType != string.Empty; 241 } 242 private void solutionCreatorTypeTextBox_TextChanged(object sender, EventArgs e) { 243 SolutionCreatorType = solutionCreatorTypeTextBox.Text.Trim(); 244 nextButton.Enabled = SolutionCreatorType != string.Empty; 245 } 74 246 } 75 247 } -
trunk/tools/Templates/HeuristicLabProblemTemplate/DefaultProblem.cs
r4188 r4214 38 38 [Creatable("Problems")] 39 39 [StorableClass] 40 public sealed class $safeitemname$ : ParameterizedNamedItem, I$problemType$ObjectiveProblem{40 public sealed class $safeitemname$ : ParameterizedNamedItem, $problemTypeImplementation$ { 41 41 public override Image ItemImage { 42 42 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; } … … 44 44 45 45 #region Parameter Properties 46 $maximizationParameterProperty$ 47 IParameter I$problemType$ObjectiveProblem.MaximizationParameter { 48 get { return MaximizationParameter; } 49 } 50 $solutionCreatorParameterProperty$ 51 IParameter IProblem.SolutionCreatorParameter { 52 get { return SolutionCreatorParameter; } 53 } 54 $evaluatorParameterProperty$ 55 IParameter IProblem.EvaluatorParameter { 56 get { return EvaluatorParameter; } 57 } 46 $problemSpecificParameterProperties$ 58 47 $parameterProperties$ 59 48 #endregion 60 49 61 50 #region Properties 51 $problemSpecificProperties$ 62 52 $properties$ 63 53 public IEnumerable<IOperator> Operators { 64 54 get { return operators; } 65 }66 ISolutionCreator IProblem.SolutionCreator {67 get { return SolutionCreatorParameter.Value; }68 }69 I$problemType$ObjectiveEvaluator I$problemType$ObjectiveProblem.Evaluator {70 get { return EvaluatorParameter.Value; }71 }72 IEvaluator IProblem.Evaluator {73 get { return EvaluatorParameter.Value; }74 55 } 75 56 #endregion … … 84 65 // TODO: Create a new instance of evaluator and solution creator 85 66 67 $problemSpecificParameterInitializers$ 86 68 $parameterInitializers$ 87 69 … … 141 123 // TODO: Add operators from the representation either by direct instantiation, or by using ApplicationManager.Manger.GetInstances<T>().Cast<IOperator>() 142 124 } 125 private void ParameterizeSolutionCreator() { 126 // TODO: Set the parameters of the solution creator 127 } 128 private void ParameterizeEvaluator() { 129 // TODO: Set the parameters of the evaluator 130 } 143 131 #endregion 144 132 } -
trunk/tools/Templates/HeuristicLabVS2010WizardsInstaller/HeuristicLabVS2010WizardsInstaller.vdproj
r4176 r4214 317 317 "ProductName" = "8:HeuristicLab 3.3 VS2010 Wizards" 318 318 "ProductCode" = "8:{B99828C4-2D65-461D-B13C-CAB57EAB6AC1}" 319 "PackageCode" = "8:{ A5414BAF-544C-469D-BAD3-302029AFF80E}"319 "PackageCode" = "8:{F12DCE28-7303-41AE-9C8D-231C0F1DA713}" 320 320 "UpgradeCode" = "8:{3AF928E8-1C64-4A5A-BC16-44CD128F21D3}" 321 321 "AspNetVersion" = "8:4.0.30319.0" … … 781 781 "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_B51E170D986C45DD9BBEEC6B70686DC9" 782 782 { 783 "SourcePath" = "8:..\\HeuristicLab.VS2010Wizards\\obj\\ Release\\HeuristicLab.VS2010Wizards.dll"783 "SourcePath" = "8:..\\HeuristicLab.VS2010Wizards\\obj\\x86\\Release\\HeuristicLab.VS2010Wizards.dll" 784 784 "TargetName" = "8:" 785 785 "Tag" = "8:" … … 791 791 "Hidden" = "11:FALSE" 792 792 "System" = "11:FALSE" 793 "Permanent" = "11: TRUE"793 "Permanent" = "11:FALSE" 794 794 "SharedLegacy" = "11:FALSE" 795 795 "PackageAs" = "3:1"
Note: See TracChangeset
for help on using the changeset viewer.