Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2882 for trunk/sources


Ignore:
Timestamp:
02/27/10 03:35:11 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on algorithms
Location:
trunk/sources
Files:
5 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Evolutionary/3.3/PopulationCreator.cs

    r2834 r2882  
    4141      get { return (ValueLookupParameter<IOperator>)Parameters["SolutionCreator"]; }
    4242    }
    43     public ValueLookupParameter<IOperator> SolutionEvaluatorParameter {
    44       get { return (ValueLookupParameter<IOperator>)Parameters["SolutionEvaluator"]; }
     43    public ValueLookupParameter<IOperator> EvaluatorParameter {
     44      get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
    4545    }
    4646    private ScopeParameter CurrentScopeParameter {
     
    5555      Parameters.Add(new ValueLookupParameter<IntData>("PopulationSize", "The number of individuals that should be created."));
    5656      Parameters.Add(new ValueLookupParameter<IOperator>("SolutionCreator", "The operator which is used to create new solutions."));
    57       Parameters.Add(new ValueLookupParameter<IOperator>("SolutionEvaluator", "The operator which is used to evaluate new solutions."));
     57      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator which is used to evaluate new solutions."));
    5858      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents the population."));
    5959    }
     
    6262      int size = PopulationSizeParameter.ActualValue.Value;
    6363      IOperator creator = SolutionCreatorParameter.ActualValue;
    64       IOperator evaluator = SolutionEvaluatorParameter.ActualValue;
     64      IOperator evaluator = EvaluatorParameter.ActualValue;
    6565
    6666      if (CurrentScope.SubScopes.Count > 0) throw new InvalidOperationException("Population is not empty. PopulationCreator cannot be applied on scopes which already contain sub-scopes.");
  • trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj

    r2830 r2882  
    9191    <Compile Include="Assigner.cs" />
    9292    <Compile Include="AlgorithmOperator.cs" />
     93    <Compile Include="ResultsCollector.cs" />
    9394    <Compile Include="MultipleCallsOperator.cs" />
    9495    <Compile Include="Operator.cs" />
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs

    r2851 r2882  
    5555      this.newProblemButton = new System.Windows.Forms.Button();
    5656      this.problemViewHost = new HeuristicLab.Core.Views.ViewHost();
     57      this.resultsTabPage = new System.Windows.Forms.TabPage();
     58      this.resultsView = new HeuristicLab.Core.Views.VariableCollectionView();
    5759      this.startButton = new System.Windows.Forms.Button();
    5860      this.stopButton = new System.Windows.Forms.Button();
     
    6769      this.parametersTabPage.SuspendLayout();
    6870      this.problemTabPage.SuspendLayout();
     71      this.resultsTabPage.SuspendLayout();
    6972      this.SuspendLayout();
    7073      //
     
    7376      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    7477      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    75       this.nameTextBox.Size = new System.Drawing.Size(418, 20);
     78      this.nameTextBox.Size = new System.Drawing.Size(607, 20);
    7679      //
    7780      // descriptionTextBox
     
    7982      this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    8083                  | System.Windows.Forms.AnchorStyles.Right)));
    81       this.descriptionTextBox.Size = new System.Drawing.Size(418, 87);
     84      this.descriptionTextBox.Size = new System.Drawing.Size(607, 87);
    8285      //
    8386      // tabControl
     
    8891      this.tabControl.Controls.Add(this.parametersTabPage);
    8992      this.tabControl.Controls.Add(this.problemTabPage);
     93      this.tabControl.Controls.Add(this.resultsTabPage);
    9094      this.tabControl.Location = new System.Drawing.Point(0, 119);
    9195      this.tabControl.Name = "tabControl";
    9296      this.tabControl.SelectedIndex = 0;
    93       this.tabControl.Size = new System.Drawing.Size(490, 204);
     97      this.tabControl.Size = new System.Drawing.Size(679, 333);
    9498      this.tabControl.TabIndex = 4;
    9599      //
     
    126130      this.problemTabPage.Name = "problemTabPage";
    127131      this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);
    128       this.problemTabPage.Size = new System.Drawing.Size(482, 178);
     132      this.problemTabPage.Size = new System.Drawing.Size(671, 307);
    129133      this.problemTabPage.TabIndex = 1;
    130134      this.problemTabPage.Text = "Problem";
     
    138142      this.saveProblemButton.Size = new System.Drawing.Size(24, 24);
    139143      this.saveProblemButton.TabIndex = 2;
     144      this.toolTip.SetToolTip(this.saveProblemButton, "Save Problem");
    140145      this.saveProblemButton.UseVisualStyleBackColor = true;
    141146      this.saveProblemButton.Click += new System.EventHandler(this.saveProblemButton_Click);
     
    148153      this.openProblemButton.Size = new System.Drawing.Size(24, 24);
    149154      this.openProblemButton.TabIndex = 1;
     155      this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");
    150156      this.openProblemButton.UseVisualStyleBackColor = true;
    151157      this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click);
     
    158164      this.newProblemButton.Size = new System.Drawing.Size(24, 24);
    159165      this.newProblemButton.TabIndex = 0;
     166      this.toolTip.SetToolTip(this.newProblemButton, "New Problem");
    160167      this.newProblemButton.UseVisualStyleBackColor = true;
    161168      this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click);
     
    169176      this.problemViewHost.Location = new System.Drawing.Point(6, 36);
    170177      this.problemViewHost.Name = "problemViewHost";
    171       this.problemViewHost.Size = new System.Drawing.Size(470, 136);
     178      this.problemViewHost.Size = new System.Drawing.Size(659, 265);
    172179      this.problemViewHost.TabIndex = 3;
    173180      this.problemViewHost.ViewType = null;
    174181      //
     182      // resultsTabPage
     183      //
     184      this.resultsTabPage.Controls.Add(this.resultsView);
     185      this.resultsTabPage.Location = new System.Drawing.Point(4, 22);
     186      this.resultsTabPage.Name = "resultsTabPage";
     187      this.resultsTabPage.Padding = new System.Windows.Forms.Padding(3);
     188      this.resultsTabPage.Size = new System.Drawing.Size(482, 178);
     189      this.resultsTabPage.TabIndex = 2;
     190      this.resultsTabPage.Text = "Results";
     191      this.resultsTabPage.UseVisualStyleBackColor = true;
     192      //
     193      // resultsView
     194      //
     195      this.resultsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     196                  | System.Windows.Forms.AnchorStyles.Left)
     197                  | System.Windows.Forms.AnchorStyles.Right)));
     198      this.resultsView.Caption = "VariableCollection";
     199      this.resultsView.Content = null;
     200      this.resultsView.Location = new System.Drawing.Point(6, 6);
     201      this.resultsView.Name = "resultsView";
     202      this.resultsView.Size = new System.Drawing.Size(470, 166);
     203      this.resultsView.TabIndex = 0;
     204      //
    175205      // startButton
    176206      //
    177207      this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    178208      this.startButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Play;
    179       this.startButton.Location = new System.Drawing.Point(0, 329);
     209      this.startButton.Location = new System.Drawing.Point(0, 458);
    180210      this.startButton.Name = "startButton";
    181211      this.startButton.Size = new System.Drawing.Size(24, 24);
    182212      this.startButton.TabIndex = 5;
     213      this.toolTip.SetToolTip(this.startButton, "Start Algorithm");
    183214      this.startButton.UseVisualStyleBackColor = true;
    184215      this.startButton.Click += new System.EventHandler(this.startButton_Click);
     
    188219      this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    189220      this.stopButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop;
    190       this.stopButton.Location = new System.Drawing.Point(30, 329);
     221      this.stopButton.Location = new System.Drawing.Point(30, 458);
    191222      this.stopButton.Name = "stopButton";
    192223      this.stopButton.Size = new System.Drawing.Size(24, 24);
    193224      this.stopButton.TabIndex = 6;
     225      this.toolTip.SetToolTip(this.stopButton, "Stop Algorithm");
    194226      this.stopButton.UseVisualStyleBackColor = true;
    195227      this.stopButton.Click += new System.EventHandler(this.stopButton_Click);
     
    199231      this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    200232      this.resetButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Restart;
    201       this.resetButton.Location = new System.Drawing.Point(60, 329);
     233      this.resetButton.Location = new System.Drawing.Point(60, 458);
    202234      this.resetButton.Name = "resetButton";
    203235      this.resetButton.Size = new System.Drawing.Size(24, 24);
    204236      this.resetButton.TabIndex = 7;
     237      this.toolTip.SetToolTip(this.resetButton, "Reset Algorithm");
    205238      this.resetButton.UseVisualStyleBackColor = true;
    206239      this.resetButton.Click += new System.EventHandler(this.resetButton_Click);
     
    210243      this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    211244      this.executionTimeLabel.AutoSize = true;
    212       this.executionTimeLabel.Location = new System.Drawing.Point(264, 336);
     245      this.executionTimeLabel.Location = new System.Drawing.Point(453, 465);
    213246      this.executionTimeLabel.Name = "executionTimeLabel";
    214247      this.executionTimeLabel.Size = new System.Drawing.Size(83, 13);
     
    219252      //
    220253      this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    221       this.executionTimeTextBox.Location = new System.Drawing.Point(353, 333);
     254      this.executionTimeTextBox.Location = new System.Drawing.Point(542, 462);
    222255      this.executionTimeTextBox.Name = "executionTimeTextBox";
    223256      this.executionTimeTextBox.ReadOnly = true;
     
    251284      this.Controls.Add(this.resetButton);
    252285      this.Name = "AlgorithmView";
    253       this.Size = new System.Drawing.Size(490, 353);
     286      this.Size = new System.Drawing.Size(679, 482);
    254287      this.Controls.SetChildIndex(this.resetButton, 0);
    255288      this.Controls.SetChildIndex(this.executionTimeLabel, 0);
     
    266299      this.parametersTabPage.ResumeLayout(false);
    267300      this.problemTabPage.ResumeLayout(false);
     301      this.resultsTabPage.ResumeLayout(false);
    268302      this.ResumeLayout(false);
    269303      this.PerformLayout();
     
    289323    protected System.Windows.Forms.OpenFileDialog openFileDialog;
    290324    protected System.Windows.Forms.SaveFileDialog saveFileDialog;
     325    protected System.Windows.Forms.TabPage resultsTabPage;
     326    protected HeuristicLab.Core.Views.VariableCollectionView resultsView;
    291327
    292328  }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs

    r2852 r2882  
    8282        parameterCollectionView.Content = null;
    8383        problemViewHost.Content = null;
     84        resultsView.Content = null;
    8485        tabControl.Enabled = false;
    8586        startButton.Enabled = resetButton.Enabled = false;
     
    9091        saveProblemButton.Enabled = Content.Problem != null;
    9192        problemViewHost.Content = Content.Problem;
     93        resultsView.Content = Content.Results;
    9294        tabControl.Enabled = true;
    9395        startButton.Enabled = !Content.Finished;
     
    106108        newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = true;
    107109        problemViewHost.Enabled = true;
     110        resultsView.Content = Content.Results;
     111        resultsView.Enabled = true;
    108112        startButton.Enabled = !Content.Finished;
    109113        stopButton.Enabled = false;
     
    128132        newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false;
    129133        problemViewHost.Enabled = false;
     134        resultsView.Enabled = false;
    130135        startButton.Enabled = false;
    131136        stopButton.Enabled = true;
     
    141146        newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = true;
    142147        problemViewHost.Enabled = true;
     148        resultsView.Enabled = true;
    143149        startButton.Enabled = !Content.Finished;
    144150        stopButton.Enabled = false;
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/ProblemView.Designer.cs

    r2851 r2882  
    5252      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5353      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    54       this.nameTextBox.Size = new System.Drawing.Size(418, 20);
    55       //
    56       // descriptionTextBox
    57       //
    58       this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    59                   | System.Windows.Forms.AnchorStyles.Right)));
    60       this.descriptionTextBox.Size = new System.Drawing.Size(418, 87);
    6154      //
    6255      // ProblemView
     
    6558      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    6659      this.Name = "ProblemView";
    67       this.Size = new System.Drawing.Size(490, 353);
    6860      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    6961      this.ResumeLayout(false);
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs

    r2851 r2882  
    4646    private void InitializeComponent() {
    4747      this.operatorGraphTabPage = new System.Windows.Forms.TabPage();
     48      this.saveOperatorGraphButton = new System.Windows.Forms.Button();
     49      this.openOperatorGraphButton = new System.Windows.Forms.Button();
     50      this.newOperatorGraphButton = new System.Windows.Forms.Button();
     51      this.operatorGraphViewHost = new HeuristicLab.Core.Views.ViewHost();
    4852      this.globalScopeTabPage = new System.Windows.Forms.TabPage();
    4953      this.globalScopeView = new HeuristicLab.Core.Views.ScopeView();
    50       this.operatorGraphViewHost = new HeuristicLab.Core.Views.ViewHost();
    51       this.newOperatorGraphButton = new System.Windows.Forms.Button();
    52       this.openOperatorGraphButton = new System.Windows.Forms.Button();
    53       this.saveOperatorGraphButton = new System.Windows.Forms.Button();
    5454      this.tabControl.SuspendLayout();
    5555      this.parametersTabPage.SuspendLayout();
    5656      this.problemTabPage.SuspendLayout();
     57      this.resultsTabPage.SuspendLayout();
    5758      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5859      this.operatorGraphTabPage.SuspendLayout();
     
    6061      this.SuspendLayout();
    6162      //
     63      // setEngineButton
     64      //
     65      this.toolTip.SetToolTip(this.setEngineButton, "Set Engine");
     66      //
     67      // createUserDefinedAlgorithmButton
     68      //
     69      this.toolTip.SetToolTip(this.createUserDefinedAlgorithmButton, "Create User Defined Algorithm from this Algorithm");
     70      //
    6271      // tabControl
    6372      //
    6473      this.tabControl.Controls.Add(this.operatorGraphTabPage);
    6574      this.tabControl.Controls.Add(this.globalScopeTabPage);
     75      this.tabControl.Controls.SetChildIndex(this.resultsTabPage, 0);
    6676      this.tabControl.Controls.SetChildIndex(this.globalScopeTabPage, 0);
    6777      this.tabControl.Controls.SetChildIndex(this.operatorGraphTabPage, 0);
    6878      this.tabControl.Controls.SetChildIndex(this.problemTabPage, 0);
    6979      this.tabControl.Controls.SetChildIndex(this.parametersTabPage, 0);
     80      //
     81      // newProblemButton
     82      //
     83      this.toolTip.SetToolTip(this.newProblemButton, "New Problem");
     84      //
     85      // saveProblemButton
     86      //
     87      this.toolTip.SetToolTip(this.saveProblemButton, "Save Problem");
     88      //
     89      // openProblemButton
     90      //
     91      this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");
     92      //
     93      // startButton
     94      //
     95      this.toolTip.SetToolTip(this.startButton, "Start Algorithm");
     96      //
     97      // stopButton
     98      //
     99      this.toolTip.SetToolTip(this.stopButton, "Stop Algorithm");
     100      //
     101      // resetButton
     102      //
     103      this.toolTip.SetToolTip(this.resetButton, "Reset Algorithm");
     104      //
     105      // resultsTabPage
     106      //
     107      this.resultsTabPage.Size = new System.Drawing.Size(648, 252);
     108      //
     109      // resultsView
     110      //
     111      this.resultsView.Size = new System.Drawing.Size(636, 240);
    70112      //
    71113      // nameTextBox
     
    82124      this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22);
    83125      this.operatorGraphTabPage.Name = "operatorGraphTabPage";
    84       this.operatorGraphTabPage.Size = new System.Drawing.Size(482, 148);
     126      this.operatorGraphTabPage.Size = new System.Drawing.Size(648, 252);
    85127      this.operatorGraphTabPage.TabIndex = 2;
    86128      this.operatorGraphTabPage.Text = "Operator Graph";
    87129      this.operatorGraphTabPage.UseVisualStyleBackColor = true;
    88130      //
     131      // saveOperatorGraphButton
     132      //
     133      this.saveOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;
     134      this.saveOperatorGraphButton.Location = new System.Drawing.Point(63, 3);
     135      this.saveOperatorGraphButton.Name = "saveOperatorGraphButton";
     136      this.saveOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     137      this.saveOperatorGraphButton.TabIndex = 1;
     138      this.toolTip.SetToolTip(this.saveOperatorGraphButton, "Save Operator Graph");
     139      this.saveOperatorGraphButton.UseVisualStyleBackColor = true;
     140      this.saveOperatorGraphButton.Click += new System.EventHandler(this.saveOperatorGraphButton_Click);
     141      //
     142      // openOperatorGraphButton
     143      //
     144      this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;
     145      this.openOperatorGraphButton.Location = new System.Drawing.Point(33, 3);
     146      this.openOperatorGraphButton.Name = "openOperatorGraphButton";
     147      this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     148      this.openOperatorGraphButton.TabIndex = 1;
     149      this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");
     150      this.openOperatorGraphButton.UseVisualStyleBackColor = true;
     151      this.openOperatorGraphButton.Click += new System.EventHandler(this.openOperatorGraphButton_Click);
     152      //
     153      // newOperatorGraphButton
     154      //
     155      this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;
     156      this.newOperatorGraphButton.Location = new System.Drawing.Point(3, 3);
     157      this.newOperatorGraphButton.Name = "newOperatorGraphButton";
     158      this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     159      this.newOperatorGraphButton.TabIndex = 1;
     160      this.toolTip.SetToolTip(this.newOperatorGraphButton, "New Operator Graph");
     161      this.newOperatorGraphButton.UseVisualStyleBackColor = true;
     162      this.newOperatorGraphButton.Click += new System.EventHandler(this.newOperatorGraphButton_Click);
     163      //
     164      // operatorGraphViewHost
     165      //
     166      this.operatorGraphViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     167                  | System.Windows.Forms.AnchorStyles.Left)
     168                  | System.Windows.Forms.AnchorStyles.Right)));
     169      this.operatorGraphViewHost.Content = null;
     170      this.operatorGraphViewHost.Location = new System.Drawing.Point(3, 33);
     171      this.operatorGraphViewHost.Name = "operatorGraphViewHost";
     172      this.operatorGraphViewHost.Size = new System.Drawing.Size(642, 216);
     173      this.operatorGraphViewHost.TabIndex = 0;
     174      this.operatorGraphViewHost.ViewType = null;
     175      //
    89176      // globalScopeTabPage
    90177      //
     
    92179      this.globalScopeTabPage.Location = new System.Drawing.Point(4, 22);
    93180      this.globalScopeTabPage.Name = "globalScopeTabPage";
    94       this.globalScopeTabPage.Size = new System.Drawing.Size(482, 148);
     181      this.globalScopeTabPage.Size = new System.Drawing.Size(648, 252);
    95182      this.globalScopeTabPage.TabIndex = 3;
    96183      this.globalScopeTabPage.Text = "Global Scope";
     
    106193      this.globalScopeView.Location = new System.Drawing.Point(3, 3);
    107194      this.globalScopeView.Name = "globalScopeView";
    108       this.globalScopeView.Size = new System.Drawing.Size(476, 142);
     195      this.globalScopeView.Size = new System.Drawing.Size(642, 246);
    109196      this.globalScopeView.TabIndex = 0;
    110       //
    111       // operatorGraphViewHost
    112       //
    113       this.operatorGraphViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    114                   | System.Windows.Forms.AnchorStyles.Left)
    115                   | System.Windows.Forms.AnchorStyles.Right)));
    116       this.operatorGraphViewHost.Content = null;
    117       this.operatorGraphViewHost.Location = new System.Drawing.Point(3, 33);
    118       this.operatorGraphViewHost.Name = "operatorGraphViewHost";
    119       this.operatorGraphViewHost.Size = new System.Drawing.Size(476, 112);
    120       this.operatorGraphViewHost.TabIndex = 0;
    121       this.operatorGraphViewHost.ViewType = null;
    122       //
    123       // newOperatorGraphButton
    124       //
    125       this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;
    126       this.newOperatorGraphButton.Location = new System.Drawing.Point(3, 3);
    127       this.newOperatorGraphButton.Name = "newOperatorGraphButton";
    128       this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
    129       this.newOperatorGraphButton.TabIndex = 1;
    130       this.newOperatorGraphButton.UseVisualStyleBackColor = true;
    131       this.newOperatorGraphButton.Click += new System.EventHandler(this.newOperatorGraphButton_Click);
    132       //
    133       // openOperatorGraphButton
    134       //
    135       this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;
    136       this.openOperatorGraphButton.Location = new System.Drawing.Point(33, 3);
    137       this.openOperatorGraphButton.Name = "openOperatorGraphButton";
    138       this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
    139       this.openOperatorGraphButton.TabIndex = 1;
    140       this.openOperatorGraphButton.UseVisualStyleBackColor = true;
    141       this.openOperatorGraphButton.Click += new System.EventHandler(this.openOperatorGraphButton_Click);
    142       //
    143       // saveOperatorGraphButton
    144       //
    145       this.saveOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;
    146       this.saveOperatorGraphButton.Location = new System.Drawing.Point(63, 3);
    147       this.saveOperatorGraphButton.Name = "saveOperatorGraphButton";
    148       this.saveOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
    149       this.saveOperatorGraphButton.TabIndex = 1;
    150       this.saveOperatorGraphButton.UseVisualStyleBackColor = true;
    151       this.saveOperatorGraphButton.Click += new System.EventHandler(this.saveOperatorGraphButton_Click);
    152197      //
    153198      // UserDefinedAlgorithmView
     
    159204      this.parametersTabPage.ResumeLayout(false);
    160205      this.problemTabPage.ResumeLayout(false);
     206      this.resultsTabPage.ResumeLayout(false);
    161207      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    162208      this.operatorGraphTabPage.ResumeLayout(false);
  • trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs

    r2864 r2882  
    2222using System;
    2323using System.Drawing;
     24using HeuristicLab.Collections;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     
    5556      }
    5657    }
     58
     59    public abstract IObservableKeyedCollection<string, IVariable> Results { get; }
    5760
    5861    public abstract TimeSpan ExecutionTime { get; }
  • trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs

    r2864 r2882  
    2121
    2222using System;
     23using HeuristicLab.Collections;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    6869    }
    6970
     71    private ReadOnlyObservableKeyedCollection<string, IVariable> readOnlyResults;
     72    public override IObservableKeyedCollection<string, IVariable> Results {
     73      get {
     74        if (readOnlyResults == null)
     75          readOnlyResults = ((VariableCollection)globalScope.Variables["Results"].Value).AsReadOnly();
     76        return readOnlyResults;
     77      }
     78    }
     79
    7080    public override TimeSpan ExecutionTime {
    7181      get {
     
    8595      : base() {
    8696      globalScope = new Scope();
     97      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    8798      OperatorGraph = new OperatorGraph();
    8899    }
     
    90101      : base(name) {
    91102      globalScope = new Scope();
     103      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    92104      OperatorGraph = new OperatorGraph();
    93105    }
     
    95107      : base(name, parameters) {
    96108      globalScope = new Scope();
     109      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    97110      OperatorGraph = new OperatorGraph();
    98111    }
     
    100113      : base(name, description) {
    101114      globalScope = new Scope();
     115      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    102116      OperatorGraph = new OperatorGraph();
    103117    }
     
    105119      : base(name, description, parameters) {
    106120      globalScope = new Scope();
     121      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
    107122      OperatorGraph = new OperatorGraph();
    108123    }
     
    133148    protected override void OnPrepared() {
    134149      globalScope.Clear();
     150      globalScope.Variables.Add(new Variable("Results", new VariableCollection()));
     151      readOnlyResults = null;
     152
    135153      if (engine != null) {
    136154        ExecutionContext context = null;
  • trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj

    r2865 r2882  
    5252    <None Include="HeuristicLabOptimizationPlugin.cs.frame" />
    5353    <Compile Include="Algorithm.cs" />
     54    <Compile Include="Interfaces\IMultiObjectiveSelector.cs" />
     55    <Compile Include="Interfaces\ISingleObjectiveSelector.cs" />
     56    <Compile Include="Interfaces\IReducer.cs" />
     57    <Compile Include="Interfaces\ISelector.cs" />
    5458    <Compile Include="Interfaces\IMultiObjectiveProblem.cs" />
    5559    <Compile Include="Interfaces\IMultiObjectiveEvaluator.cs" />
  • trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IAlgorithm.cs

    r2864 r2882  
    2121
    2222using System;
     23using HeuristicLab.Collections;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    3132    Type ProblemType { get; }
    3233    IProblem Problem { get; set; }
     34    IObservableKeyedCollection<string, IVariable> Results { get; }
    3335    TimeSpan ExecutionTime { get; }
    3436    bool Running { get; }
  • trunk/sources/HeuristicLab.Routing.TSP.Views/3.3/TSPView.Designer.cs

    r2834 r2882  
    5252      // parameterCollectionView
    5353      //
    54       this.parameterCollectionView.Size = new System.Drawing.Size(490, 205);
     54      this.parameterCollectionView.Size = new System.Drawing.Size(529, 274);
    5555      //
    5656      // nameTextBox
     
    5858      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5959      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
     60      this.nameTextBox.Size = new System.Drawing.Size(457, 20);
     61      //
     62      // descriptionTextBox
     63      //
     64      this.descriptionTextBox.Size = new System.Drawing.Size(457, 87);
    6065      //
    6166      // openFileDialog
     
    7075      this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    7176                  | System.Windows.Forms.AnchorStyles.Right)));
    72       this.importButton.Location = new System.Drawing.Point(0, 330);
     77      this.importButton.Location = new System.Drawing.Point(0, 399);
    7378      this.importButton.Name = "importButton";
    74       this.importButton.Size = new System.Drawing.Size(490, 23);
     79      this.importButton.Size = new System.Drawing.Size(529, 23);
    7580      this.importButton.TabIndex = 5;
    7681      this.importButton.Text = "&Import from TSPLIB";
     
    8489      this.Controls.Add(this.importButton);
    8590      this.Name = "TSPView";
     91      this.Size = new System.Drawing.Size(529, 422);
    8692      this.Controls.SetChildIndex(this.importButton, 0);
    8793      this.Controls.SetChildIndex(this.parameterCollectionView, 0);
  • trunk/sources/HeuristicLab.Routing.TSP/3.3/TSP.cs

    r2865 r2882  
    101101      EvaluatorParameter.Value = evaluator;
    102102
    103       operators = new OperatorSet();
    104       var crossovers = ApplicationManager.Manager.GetInstances<IPermutationCrossover>().ToList();
    105       crossovers.ForEach(x => {
    106         x.ParentsParameter.ActualName = creator.PermutationParameter.ActualName;
    107         x.ChildParameter.ActualName = creator.PermutationParameter.ActualName;
     103      var ops = ApplicationManager.Manager.GetInstances<IPermutationOperator>().ToList();
     104      ops.ForEach(x => {
     105        IPermutationCrossover y = x as IPermutationCrossover;
     106        if (y != null) {
     107          y.ParentsParameter.ActualName = creator.PermutationParameter.ActualName;
     108          y.ChildParameter.ActualName = creator.PermutationParameter.ActualName;
     109        }
    108110      });
    109       var manipulators = ApplicationManager.Manager.GetInstances<IPermutationManipulator>().ToList();
    110       manipulators.ForEach(x => x.PermutationParameter.ActualName = creator.PermutationParameter.ActualName);
    111       operators = new OperatorSet(crossovers.Cast<IOperator>().Concat(manipulators.Cast<IOperator>()));
     111      ops.ForEach(x => {
     112        IPermutationManipulator y = x as IPermutationManipulator;
     113        if (y != null)
     114          y.PermutationParameter.ActualName = creator.PermutationParameter.ActualName;
     115      });
     116      operators = new OperatorSet(ops.Cast<IOperator>());
    112117    }
    113118
  • trunk/sources/HeuristicLab.SGA/3.3/SGA.cs

    r2865 r2882  
    2929using HeuristicLab.Parameters;
    3030using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HeuristicLab.PluginInfrastructure;
    3132
    3233namespace HeuristicLab.SGA {
     
    4243    private SGAOperator sgaOperator;
    4344
    44     private ConstrainedValueParameter<ICrossover> CrossoverOperatorParameter {
    45       get { return (ConstrainedValueParameter<ICrossover>)Parameters["CrossoverOperator"]; }
     45    private ValueParameter<IntData> PopulationSizeParameter {
     46      get { return (ValueParameter<IntData>)Parameters["PopulationSize"]; }
    4647    }
    47     private ConstrainedValueParameter<IManipulator> MutationOperatorParameter {
    48       get { return (ConstrainedValueParameter<IManipulator>)Parameters["MutationOperator"]; }
     48    private ConstrainedValueParameter<ISelector> SelectorParameter {
     49      get { return (ConstrainedValueParameter<ISelector>)Parameters["Selector"]; }
     50    }
     51    private ConstrainedValueParameter<ICrossover> CrossoverParameter {
     52      get { return (ConstrainedValueParameter<ICrossover>)Parameters["Crossover"]; }
     53    }
     54    private ConstrainedValueParameter<IManipulator> MutatorParameter {
     55      get { return (ConstrainedValueParameter<IManipulator>)Parameters["Mutator"]; }
     56    }
     57    private ValueParameter<IntData> ElitesParameter {
     58      get { return (ValueParameter<IntData>)Parameters["Elites"]; }
    4959    }
    5060
     
    6272      Parameters.Add(new ValueParameter<BoolData>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolData(true)));
    6373      Parameters.Add(new ValueParameter<IntData>("PopulationSize", "The size of the population of solutions.", new IntData(100)));
    64       Parameters.Add(new ConstrainedValueParameter<ICrossover>("CrossoverOperator", "The operator used to cross solutions."));
     74      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
     75      Parameters.Add(new ConstrainedValueParameter<ICrossover>("Crossover", "The operator used to cross solutions."));
    6576      Parameters.Add(new ValueParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution.", new DoubleData(0.05)));
    66       Parameters.Add(new ConstrainedValueParameter<IManipulator>("MutationOperator", "The operator used to mutate solutions."));
     77      Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    6778      Parameters.Add(new ValueParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.", new IntData(1)));
    6879      Parameters.Add(new ValueParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntData(1000)));
     80
     81      PopulationSizeParameter.ValueChanged += new EventHandler(PopulationSizeParameter_ValueChanged);
     82      ElitesParameter.ValueChanged += new EventHandler(ElitesParameter_ValueChanged);
    6983
    7084      RandomCreator randomCreator = new RandomCreator();
     
    8397      populationCreator.Successor = sgaOperator;
    8498
    85       sgaOperator.CrossoverOperatorParameter.ActualName = "CrossoverOperator";
     99      sgaOperator.SelectorParameter.ActualName = "Selector";
     100      sgaOperator.CrossoverParameter.ActualName = "Crossover";
    86101      sgaOperator.ElitesParameter.ActualName = "Elites";
    87102      sgaOperator.MaximumGenerationsParameter.ActualName = "MaximumGenerations";
    88       sgaOperator.MutationOperatorParameter.ActualName = "MutationOperator";
     103      sgaOperator.MutatorParameter.ActualName = "Mutator";
    89104      sgaOperator.MutationProbabilityParameter.ActualName = "MutationProbability";
    90105      sgaOperator.RandomParameter.ActualName = "Random";
     106      sgaOperator.ResultsParameter.ActualName = "Results";
    91107
    92108      OperatorGraph.InitialOperator = randomCreator;
     109
     110      var selectors = ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector));
     111      selectors.Select(x => x.CopySelected = new BoolData(true));
     112      selectors.Select(x => x.NumberOfSelectedSubScopesParameter.Value = new IntData(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value)));
     113      selectors.OfType<IStochasticOperator>().Select(x => x.RandomParameter.ActualName = "Random");
     114      foreach (ISelector selector in selectors)
     115        SelectorParameter.ValidValues.Add(selector);
    93116    }
    94117
     
    98121      clone.sgaOperator = (SGAOperator)cloner.Clone(sgaOperator);
    99122      return clone;
     123    }
     124
     125    private void ElitesParameter_ValueChanged(object sender, EventArgs e) {
     126      SelectorParameter.ValidValues.Select(x => x.NumberOfSelectedSubScopesParameter.Value = new IntData(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value)));
     127    }
     128    private void PopulationSizeParameter_ValueChanged(object sender, EventArgs e) {
     129      SelectorParameter.ValidValues.Select(x => x.NumberOfSelectedSubScopesParameter.Value = new IntData(2 * (PopulationSizeParameter.Value.Value - ElitesParameter.Value.Value)));
    100130    }
    101131
     
    112142      if (Problem.SolutionCreator is IStochasticOperator) ((IStochasticOperator)Problem.SolutionCreator).RandomParameter.ActualName = "Random";
    113143      if (Problem.Evaluator is IStochasticOperator) ((IStochasticOperator)Problem.Evaluator).RandomParameter.ActualName = "Random";
    114       Problem.Operators.Where(x => x is IStochasticOperator).Select(x => (x as IStochasticOperator).RandomParameter.ActualName = "Random");
     144      Problem.Operators.OfType<IStochasticOperator>().Select(x => x.RandomParameter.ActualName = "Random");
    115145
    116146      populationCreator.SolutionCreatorParameter.Value = Problem.SolutionCreator;
    117       populationCreator.SolutionEvaluatorParameter.Value = Problem.Evaluator;
     147      populationCreator.EvaluatorParameter.Value = Problem.Evaluator;
    118148      sgaOperator.MaximizationParameter.Value = Problem.Maximization;
    119149      sgaOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    120       sgaOperator.SolutionEvaluatorParameter.Value = Problem.Evaluator;
     150      sgaOperator.EvaluatorParameter.Value = Problem.Evaluator;
    121151
    122       CrossoverOperatorParameter.ValidValues.Clear();
    123       var crossovers = from o in Problem.Operators
    124                        where o is ICrossover
    125                        select (ICrossover)o;
    126       foreach (ICrossover crossover in crossovers)
    127         CrossoverOperatorParameter.ValidValues.Add(crossover);
     152      SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>().Select(x => x.MaximizationParameter.Value = Problem.Maximization);
     153      SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>().Select(x => x.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName);
    128154
    129       MutationOperatorParameter.ValidValues.Clear();
    130       var mutators = from o in Problem.Operators
    131                      where o is IManipulator
    132                      select (IManipulator)o;
    133       foreach (IManipulator mutator in mutators)
    134         MutationOperatorParameter.ValidValues.Add(mutator);
     155      CrossoverParameter.ValidValues.Clear();
     156      foreach (ICrossover crossover in Problem.Operators.OfType<ICrossover>())
     157        CrossoverParameter.ValidValues.Add(crossover);
     158
     159      MutatorParameter.ValidValues.Clear();
     160      foreach (IManipulator mutator in Problem.Operators.OfType<IManipulator>())
     161        MutatorParameter.ValidValues.Add(mutator);
    135162
    136163      base.OnProblemChanged();
     
    143170    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
    144171      if (Problem.Evaluator is IStochasticOperator) ((IStochasticOperator)Problem.Evaluator).RandomParameter.ActualName = "Random";
    145       populationCreator.SolutionEvaluatorParameter.Value = Problem.Evaluator;
     172      SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>().Select(x => x.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName);
     173      populationCreator.EvaluatorParameter.Value = Problem.Evaluator;
    146174      sgaOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    147       sgaOperator.SolutionEvaluatorParameter.Value = Problem.Evaluator;
     175      sgaOperator.EvaluatorParameter.Value = Problem.Evaluator;
    148176      base.Problem_EvaluatorChanged(sender, e);
    149177    }
    150178    private void Problem_MaximizationChanged(object sender, EventArgs e) {
    151179      sgaOperator.MaximizationParameter.Value = Problem.Maximization;
     180      SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>().Select(x => x.MaximizationParameter.Value = Problem.Maximization);
    152181    }
    153182  }
  • trunk/sources/HeuristicLab.SGA/3.3/SGAOperator.cs

    r2834 r2882  
    3535  [Creatable("Test")]
    3636  public class SGAOperator : AlgorithmOperator {
    37     [Storable]
    38     private ProportionalSelector proportionalSelector;
    39 
    4037    #region Parameter properties
    4138    public ValueLookupParameter<IRandom> RandomParameter {
     
    4845      get { return (SubScopesLookupParameter<DoubleData>)Parameters["Quality"]; }
    4946    }
    50     public ValueLookupParameter<IOperator> CrossoverOperatorParameter {
    51       get { return (ValueLookupParameter<IOperator>)Parameters["CrossoverOperator"]; }
     47    public ValueLookupParameter<IOperator> SelectorParameter {
     48      get { return (ValueLookupParameter<IOperator>)Parameters["Selector"]; }
     49    }
     50    public ValueLookupParameter<IOperator> CrossoverParameter {
     51      get { return (ValueLookupParameter<IOperator>)Parameters["Crossover"]; }
    5252    }
    5353    public ValueLookupParameter<DoubleData> MutationProbabilityParameter {
    5454      get { return (ValueLookupParameter<DoubleData>)Parameters["MutationProbability"]; }
    5555    }
    56     public ValueLookupParameter<IOperator> MutationOperatorParameter {
    57       get { return (ValueLookupParameter<IOperator>)Parameters["MutationOperator"]; }
     56    public ValueLookupParameter<IOperator> MutatorParameter {
     57      get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; }
    5858    }
    59     public ValueLookupParameter<IOperator> SolutionEvaluatorParameter {
    60       get { return (ValueLookupParameter<IOperator>)Parameters["SolutionEvaluator"]; }
     59    public ValueLookupParameter<IOperator> EvaluatorParameter {
     60      get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
    6161    }
    6262    public ValueLookupParameter<IntData> ElitesParameter {
     
    6565    public ValueLookupParameter<IntData> MaximumGenerationsParameter {
    6666      get { return (ValueLookupParameter<IntData>)Parameters["MaximumGenerations"]; }
     67    }
     68    public ValueLookupParameter<VariableCollection> ResultsParameter {
     69      get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; }
    6770    }
    6871    private ScopeParameter CurrentScopeParameter {
     
    8184      Parameters.Add(new ValueLookupParameter<BoolData>("Maximization", "True if the problem is a maximization problem, otherwise false."));
    8285      Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The value which represents the quality of a solution."));
    83       Parameters.Add(new ValueLookupParameter<IOperator>("CrossoverOperator", "The operator used to cross solutions."));
     86      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
     87      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
    8488      Parameters.Add(new ValueLookupParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
    85       Parameters.Add(new ValueLookupParameter<IOperator>("MutationOperator", "The operator used to mutate solutions."));
    86       Parameters.Add(new ValueLookupParameter<IOperator>("SolutionEvaluator", "The operator used to evaluate solutions."));
     89      Parameters.Add(new ValueLookupParameter<IOperator>("Mutator", "The operator used to mutate solutions."));
     90      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));
    8791      Parameters.Add(new ValueLookupParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation."));
    8892      Parameters.Add(new ValueLookupParameter<IntData>("MaximumGenerations", "The maximum number of generations which should be processed."));
     93      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
    8994      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the SGA should be applied."));
    9095      #endregion
     
    9297      #region Create operator graph
    9398      SubScopesSorter subScopesSorter1 = new SubScopesSorter();
    94       proportionalSelector = new ProportionalSelector();
     99      Placeholder selector = new Placeholder();
    95100      SequentialSubScopesProcessor sequentialSubScopesProcessor1 = new SequentialSubScopesProcessor();
    96101      ChildrenCreator childrenCreator = new ChildrenCreator();
     
    108113      IntCounter intCounter = new IntCounter();
    109114      Comparator comparator = new Comparator();
     115      ResultsCollector resultsCollector = new ResultsCollector();
    110116      ConditionalBranch conditionalBranch = new ConditionalBranch();
    111117
     
    113119      subScopesSorter1.ValueParameter.ActualName = "Quality";
    114120      OperatorGraph.InitialOperator = subScopesSorter1;
    115       subScopesSorter1.Successor = proportionalSelector;
     121      subScopesSorter1.Successor = selector;
    116122
    117       proportionalSelector.CopySelected = new BoolData(true);
    118       proportionalSelector.MaximizationParameter.ActualName = "Maximization";
    119       // NOTE: NumberOfSelectedSubScopes is set dynamically when the operator is executed
    120       proportionalSelector.QualityParameter.ActualName = "Quality";
    121       proportionalSelector.RandomParameter.ActualName = "Random";
    122       proportionalSelector.Windowing = new BoolData(true);
    123       proportionalSelector.Successor = sequentialSubScopesProcessor1;
     123      selector.Name = "Selector";
     124      selector.OperatorParameter.ActualName = "Selector";
     125      selector.Successor = sequentialSubScopesProcessor1;
    124126
    125127      sequentialSubScopesProcessor1.Operators.Add(new EmptyOperator());
     
    133135      uniformSequentialSubScopesProcessor.Successor = subScopesSorter2;
    134136
    135       crossover.Name = "CrossoverOperator";
    136       crossover.OperatorParameter.ActualName = "CrossoverOperator";
     137      crossover.Name = "Crossover";
     138      crossover.OperatorParameter.ActualName = "Crossover";
    137139      crossover.Successor = stochasticBranch;
    138140
     
    143145      stochasticBranch.Successor = evaluator;
    144146
    145       mutator.Name = "MutationOperator";
    146       mutator.OperatorParameter.ActualName = "MutationOperator";
     147      mutator.Name = "Mutator";
     148      mutator.OperatorParameter.ActualName = "Mutator";
    147149      mutator.Successor = null;
    148150
    149       evaluator.Name = "SolutionEvaluator";
    150       evaluator.OperatorParameter.ActualName = "SolutionEvaluator";
     151      evaluator.Name = "Evaluator";
     152      evaluator.OperatorParameter.ActualName = "Evaluator";
    151153      evaluator.Successor = subScopesRemover;
    152154
     
    178180      comparator.ResultParameter.ActualName = "Terminate";
    179181      comparator.RightSideParameter.ActualName = "MaximumGenerations";
    180       comparator.Successor = conditionalBranch;
     182      comparator.Successor = resultsCollector;
     183
     184      SubScopesLookupParameter<DoubleData> quality = new SubScopesLookupParameter<DoubleData>("Qualities");
     185      quality.ActualName = "Quality";
     186      resultsCollector.CollectedValues.Add(quality);
     187      resultsCollector.ResultsParameter.ActualName = "Results";
     188      resultsCollector.Successor = conditionalBranch;
    181189
    182190      conditionalBranch.ConditionParameter.ActualName = "Terminate";
     
    186194      #endregion
    187195    }
    188 
    189     public override IDeepCloneable Clone(Cloner cloner) {
    190       SGAOperator clone = (SGAOperator)base.Clone(cloner);
    191       clone.proportionalSelector = (ProportionalSelector)cloner.Clone(proportionalSelector);
    192       return clone;
    193     }
    194 
    195     public override IOperation Apply() {
    196       int populationSize = CurrentScope.SubScopes.Count;
    197       // dynamically set the number of parents which are selected for reproduction
    198       proportionalSelector.NumberOfSelectedSubScopesParameter.Value = new IntData(2 * (populationSize - ElitesParameter.ActualValue.Value));
    199       return base.Apply();
    200     }
    201196  }
    202197}
  • trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj

    r2817 r2882  
    119119      <Name>HeuristicLab.Operators-3.3</Name>
    120120    </ProjectReference>
     121    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
     122      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
     123      <Name>HeuristicLab.Optimization-3.3</Name>
     124    </ProjectReference>
    121125    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    122126      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
  • trunk/sources/HeuristicLab.Selection/3.3/HeuristicLabSelectionPlugin.cs.frame

    r2818 r2882  
    3232  [PluginDependency("HeuristicLab.Data", "3.3")]
    3333  [PluginDependency("HeuristicLab.Operators", "3.3")]
     34  [PluginDependency("HeuristicLab.Optimization", "3.3")]
    3435  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3536  [PluginDependency("HeuristicLab.Persistence", "3.3")]
  • trunk/sources/HeuristicLab.Selection/3.3/Reducer.cs

    r2834 r2882  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Operators;
     25using HeuristicLab.Optimization;
    2526using HeuristicLab.Parameters;
    2627using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3233  [Item("Reducer", "A base class for reduction operators.")]
    3334  [EmptyStorableClass]
    34   public abstract class Reducer : SingleSuccessorOperator {
     35  public abstract class Reducer : SingleSuccessorOperator, IReducer {
    3536    protected ScopeParameter CurrentScopeParameter {
    3637      get { return (ScopeParameter)Parameters["CurrentScope"]; }
  • trunk/sources/HeuristicLab.Selection/3.3/Selector.cs

    r2834 r2882  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Operators;
     26using HeuristicLab.Optimization;
    2627using HeuristicLab.Parameters;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3334  [Item("Selector", "A base class for selection operators.")]
    3435  [EmptyStorableClass]
    35   public abstract class Selector : SingleSuccessorOperator {
     36  public abstract class Selector : SingleSuccessorOperator, ISelector {
    3637    protected ValueParameter<BoolData> CopySelectedParameter {
    3738      get { return (ValueParameter<BoolData>)Parameters["CopySelected"]; }
    3839    }
    39     public ValueLookupParameter<IntData> NumberOfSelectedSubScopesParameter {
     40    public IValueLookupParameter<IntData> NumberOfSelectedSubScopesParameter {
    4041      get { return (ValueLookupParameter<IntData>)Parameters["NumberOfSelectedSubScopes"]; }
    4142    }
  • trunk/sources/HeuristicLab.Selection/3.3/StochasticSelector.cs

    r2818 r2882  
    2121
    2222using HeuristicLab.Core;
     23using HeuristicLab.Optimization;
    2324using HeuristicLab.Parameters;
    2425using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3031  [Item("StochasticSelector", "A base class for stochastic selection operators.")]
    3132  [EmptyStorableClass]
    32   public abstract class StochasticSelector : Selector {
    33     public LookupParameter<IRandom> RandomParameter {
     33  public abstract class StochasticSelector : Selector, IStochasticOperator {
     34    public ILookupParameter<IRandom> RandomParameter {
    3435      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    3536    }
  • trunk/sources/HeuristicLab.Selection/3.3/StochasticSingleObjectiveSelector.cs

    r2818 r2882  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Data;
     24using HeuristicLab.Optimization;
    2425using HeuristicLab.Parameters;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3132  [Item("StochasticSingleObjectiveSelector", "A base class for stochastic selection operators which consider a single double quality value for selection.")]
    3233  [EmptyStorableClass]
    33   public abstract class StochasticSingleObjectiveSelector : StochasticSelector {
    34     public LookupParameter<BoolData> MaximizationParameter {
    35       get { return (LookupParameter<BoolData>)Parameters["Maximization"]; }
     34  public abstract class StochasticSingleObjectiveSelector : StochasticSelector, ISingleObjectiveSelector {
     35    public IValueLookupParameter<BoolData> MaximizationParameter {
     36      get { return (IValueLookupParameter<BoolData>)Parameters["Maximization"]; }
    3637    }
    37     public SubScopesLookupParameter<DoubleData> QualityParameter {
    38       get { return (SubScopesLookupParameter<DoubleData>)Parameters["Quality"]; }
     38    public ILookupParameter<ItemArray<DoubleData>> QualityParameter {
     39      get { return (ILookupParameter<ItemArray<DoubleData>>)Parameters["Quality"]; }
    3940    }
    4041
    4142    protected StochasticSingleObjectiveSelector()
    4243      : base() {
    43       Parameters.Add(new LookupParameter<BoolData>("Maximization", "True if the current problem is a maximization problem, otherwise false."));
     44      Parameters.Add(new ValueLookupParameter<BoolData>("Maximization", "True if the current problem is a maximization problem, otherwise false."));
    4445      Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The quality value contained in each sub-scope which is used for selection."));
    4546    }
Note: See TracChangeset for help on using the changeset viewer.