Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4214 for trunk/tools


Ignore:
Timestamp:
08/14/10 18:31:09 (14 years ago)
Author:
abeham
Message:

#567

  • Added problem wizard
Location:
trunk/tools/Templates
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/Templates/HeuristicLab.VS2010Wizards.Test/Program.cs

    r4181 r4214  
    1313      Application.EnableVisualStyles();
    1414      Application.SetCompatibleTextRenderingDefault(false);
    15       Application.Run(new AlgorithmWizardForm());
     15      Application.Run(new ProblemWizardForm());
    1616    }
    1717  }
  • trunk/tools/Templates/HeuristicLab.VS2010Wizards/ParametersControl.Designer.cs

    r4188 r4214  
    158158            "Lookup",
    159159            "ValueLookup",
     160            "OptionalValue",
     161            "ConstrainedValue",
     162            "OptionalConstrainedValue",
    160163            "ScopeTreeLookup"});
    161164      this.parameterTypeComboBox.Location = new System.Drawing.Point(3, 232);
  • trunk/tools/Templates/HeuristicLab.VS2010Wizards/ProblemWizard.cs

    r4188 r4214  
    4949        replacementsDictionary.Add("$problemName$", form.ProblemName);
    5050        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);
    5555        replacementsDictionary.Add("$parameterProperties$", form.ParameterProperties);
    5656        replacementsDictionary.Add("$properties$", form.Properties);
  • trunk/tools/Templates/HeuristicLab.VS2010Wizards/ProblemWizardForm.Designer.cs

    r4188 r4214  
    2828      this.label2 = new System.Windows.Forms.Label();
    2929      this.problemDescriptionTextBox = new System.Windows.Forms.TextBox();
    30       this.isMultiObjectiveCheckBox = new System.Windows.Forms.CheckBox();
     30      this.multiObjectiveCheckBox = new System.Windows.Forms.CheckBox();
    3131      this.problemNameTextBox = new System.Windows.Forms.TextBox();
    3232      this.cancelButton = new System.Windows.Forms.Button();
     
    3737      this.page2Panel = new System.Windows.Forms.Panel();
    3838      this.label3 = new System.Windows.Forms.Label();
    39       this.parametersControl = new HeuristicLab.VS2010Wizards.ParametersControl();
    4039      this.panel2 = new System.Windows.Forms.Panel();
    4140      this.nextButton = new System.Windows.Forms.Button();
    4241      this.previousButton = new System.Windows.Forms.Button();
    4342      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();
    4450      this.panel1.SuspendLayout();
    4551      ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
    4652      this.page2Panel.SuspendLayout();
    4753      this.page1Panel.SuspendLayout();
     54      this.contentPanel.SuspendLayout();
    4855      this.SuspendLayout();
    4956      //
     
    5259      this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
    5360      this.label1.AutoSize = true;
    54       this.label1.Location = new System.Drawing.Point(100, 48);
     61      this.label1.Location = new System.Drawing.Point(100, 19);
    5562      this.label1.Name = "label1";
    5663      this.label1.Size = new System.Drawing.Size(38, 13);
     
    6269      this.label2.Anchor = System.Windows.Forms.AnchorStyles.None;
    6370      this.label2.AutoSize = true;
    64       this.label2.Location = new System.Drawing.Point(100, 96);
     71      this.label2.Location = new System.Drawing.Point(100, 67);
    6572      this.label2.Name = "label2";
    6673      this.label2.Size = new System.Drawing.Size(63, 13);
     
    7178      //
    7279      this.problemDescriptionTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    73       this.problemDescriptionTextBox.Location = new System.Drawing.Point(102, 112);
     80      this.problemDescriptionTextBox.Location = new System.Drawing.Point(103, 83);
    7481      this.problemDescriptionTextBox.Multiline = true;
    7582      this.problemDescriptionTextBox.Name = "problemDescriptionTextBox";
    76       this.problemDescriptionTextBox.Size = new System.Drawing.Size(469, 63);
     83      this.problemDescriptionTextBox.Size = new System.Drawing.Size(468, 63);
    7784      this.problemDescriptionTextBox.TabIndex = 3;
    7885      //
    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);
    8997      //
    9098      // problemNameTextBox
    9199      //
    92100      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);
    94102      this.problemNameTextBox.Name = "problemNameTextBox";
    95103      this.problemNameTextBox.Size = new System.Drawing.Size(468, 20);
     
    152160      // page2Panel
    153161      //
    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)));
    157162      this.page2Panel.Controls.Add(this.label3);
    158163      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);
    160166      this.page2Panel.Name = "page2Panel";
    161       this.page2Panel.Size = new System.Drawing.Size(676, 289);
     167      this.page2Panel.Size = new System.Drawing.Size(676, 293);
    162168      this.page2Panel.TabIndex = 10;
    163169      this.page2Panel.Visible = false;
     
    171177      this.label3.TabIndex = 1;
    172178      this.label3.Text = "Parameters:";
    173       //
    174       // parametersControl
    175       //
    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;
    183179      //
    184180      // panel2
     
    218214      // page1Panel
    219215      //
    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);
    223220      this.page1Panel.Controls.Add(this.label1);
    224221      this.page1Panel.Controls.Add(this.label2);
    225222      this.page1Panel.Controls.Add(this.problemDescriptionTextBox);
    226223      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);
    229228      this.page1Panel.Name = "page1Panel";
    230       this.page1Panel.Size = new System.Drawing.Size(676, 298);
     229      this.page1Panel.Size = new System.Drawing.Size(676, 293);
    231230      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;
    232307      //
    233308      // ProblemWizardForm
     
    236311      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    237312      this.ClientSize = new System.Drawing.Size(676, 428);
     313      this.Controls.Add(this.contentPanel);
    238314      this.Controls.Add(this.panel1);
    239315      this.Controls.Add(this.cancelButton);
     
    242318      this.Controls.Add(this.finishButton);
    243319      this.Controls.Add(this.panel2);
    244       this.Controls.Add(this.page2Panel);
    245       this.Controls.Add(this.page1Panel);
    246320      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
    247321      this.Name = "ProblemWizardForm";
     
    254328      this.page1Panel.ResumeLayout(false);
    255329      this.page1Panel.PerformLayout();
     330      this.contentPanel.ResumeLayout(false);
    256331      this.ResumeLayout(false);
    257332
     
    263338    private System.Windows.Forms.Label label2;
    264339    private System.Windows.Forms.TextBox problemDescriptionTextBox;
    265     private System.Windows.Forms.CheckBox isMultiObjectiveCheckBox;
     340    private System.Windows.Forms.CheckBox multiObjectiveCheckBox;
    266341    private System.Windows.Forms.TextBox problemNameTextBox;
    267342    private System.Windows.Forms.Button cancelButton;
     
    277352    private ParametersControl parametersControl;
    278353    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;
    279360  }
    280361}
  • trunk/tools/Templates/HeuristicLab.VS2010Wizards/ProblemWizardForm.cs

    r4188 r4214  
    1818      private set;
    1919    }
     20    public bool IsSingleObjective {
     21      get;
     22      private set;
     23    }
    2024    public bool IsMultiObjective {
    2125      get;
     
    3135    }
    3236    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 {
    3361      get;
    3462      private set;
     
    3765    public ProblemWizardForm() {
    3866      InitializeComponent();
     67      IsSingleObjective = singleObjectiveCheckBox.Checked;
     68      IsMultiObjective = multiObjectiveCheckBox.Checked;
     69      EvaluatorType = evaluatorTypeTextBox.Text;
     70      SolutionCreatorType = solutionCreatorTypeTextBox.Text;
    3971    }
    4072
     
    5385      ProblemName = problemNameTextBox.Text;
    5486      ProblemDescription = problemDescriptionTextBox.Text;
    55       IsMultiObjective = isMultiObjectiveCheckBox.Checked;
    56       ParameterProperties = parametersControl.GetParameterProperties("private");
     87      IsMultiObjective = multiObjectiveCheckBox.Checked;
     88      ParameterProperties = parametersControl.GetParameterProperties("public");
    5789      Properties = parametersControl.GetProperties("public");
    5890      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();
    59208    }
    60209
     
    72221      nextButton.Enabled = true;
    73222    }
     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    }
    74246  }
    75247}
  • trunk/tools/Templates/HeuristicLabProblemTemplate/DefaultProblem.cs

    r4188 r4214  
    3838  [Creatable("Problems")]
    3939  [StorableClass]
    40   public sealed class $safeitemname$ : ParameterizedNamedItem, I$problemType$ObjectiveProblem {
     40  public sealed class $safeitemname$ : ParameterizedNamedItem, $problemTypeImplementation$ {
    4141    public override Image ItemImage {
    4242      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
     
    4444
    4545    #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$
    5847    $parameterProperties$
    5948    #endregion
    6049
    6150    #region Properties
     51    $problemSpecificProperties$
    6252    $properties$
    6353    public IEnumerable<IOperator> Operators {
    6454      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; }
    7455    }
    7556    #endregion
     
    8465      // TODO: Create a new instance of evaluator and solution creator
    8566
     67      $problemSpecificParameterInitializers$
    8668      $parameterInitializers$
    8769
     
    141123      // TODO: Add operators from the representation either by direct instantiation, or by using ApplicationManager.Manger.GetInstances<T>().Cast<IOperator>()
    142124    }
     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    }
    143131    #endregion
    144132  }
  • trunk/tools/Templates/HeuristicLabVS2010WizardsInstaller/HeuristicLabVS2010WizardsInstaller.vdproj

    r4176 r4214  
    317317        "ProductName" = "8:HeuristicLab 3.3 VS2010 Wizards"
    318318        "ProductCode" = "8:{B99828C4-2D65-461D-B13C-CAB57EAB6AC1}"
    319         "PackageCode" = "8:{A5414BAF-544C-469D-BAD3-302029AFF80E}"
     319        "PackageCode" = "8:{F12DCE28-7303-41AE-9C8D-231C0F1DA713}"
    320320        "UpgradeCode" = "8:{3AF928E8-1C64-4A5A-BC16-44CD128F21D3}"
    321321        "AspNetVersion" = "8:4.0.30319.0"
     
    781781            "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_B51E170D986C45DD9BBEEC6B70686DC9"
    782782            {
    783             "SourcePath" = "8:..\\HeuristicLab.VS2010Wizards\\obj\\Release\\HeuristicLab.VS2010Wizards.dll"
     783            "SourcePath" = "8:..\\HeuristicLab.VS2010Wizards\\obj\\x86\\Release\\HeuristicLab.VS2010Wizards.dll"
    784784            "TargetName" = "8:"
    785785            "Tag" = "8:"
     
    791791            "Hidden" = "11:FALSE"
    792792            "System" = "11:FALSE"
    793             "Permanent" = "11:TRUE"
     793            "Permanent" = "11:FALSE"
    794794            "SharedLegacy" = "11:FALSE"
    795795            "PackageAs" = "3:1"
Note: See TracChangeset for help on using the changeset viewer.