Changeset 2882 for trunk/sources
- Timestamp:
- 02/27/10 03:35:11 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Evolutionary/3.3/PopulationCreator.cs
r2834 r2882 41 41 get { return (ValueLookupParameter<IOperator>)Parameters["SolutionCreator"]; } 42 42 } 43 public ValueLookupParameter<IOperator> SolutionEvaluatorParameter {44 get { return (ValueLookupParameter<IOperator>)Parameters[" SolutionEvaluator"]; }43 public ValueLookupParameter<IOperator> EvaluatorParameter { 44 get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; } 45 45 } 46 46 private ScopeParameter CurrentScopeParameter { … … 55 55 Parameters.Add(new ValueLookupParameter<IntData>("PopulationSize", "The number of individuals that should be created.")); 56 56 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.")); 58 58 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents the population.")); 59 59 } … … 62 62 int size = PopulationSizeParameter.ActualValue.Value; 63 63 IOperator creator = SolutionCreatorParameter.ActualValue; 64 IOperator evaluator = SolutionEvaluatorParameter.ActualValue;64 IOperator evaluator = EvaluatorParameter.ActualValue; 65 65 66 66 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 91 91 <Compile Include="Assigner.cs" /> 92 92 <Compile Include="AlgorithmOperator.cs" /> 93 <Compile Include="ResultsCollector.cs" /> 93 94 <Compile Include="MultipleCallsOperator.cs" /> 94 95 <Compile Include="Operator.cs" /> -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs
r2851 r2882 55 55 this.newProblemButton = new System.Windows.Forms.Button(); 56 56 this.problemViewHost = new HeuristicLab.Core.Views.ViewHost(); 57 this.resultsTabPage = new System.Windows.Forms.TabPage(); 58 this.resultsView = new HeuristicLab.Core.Views.VariableCollectionView(); 57 59 this.startButton = new System.Windows.Forms.Button(); 58 60 this.stopButton = new System.Windows.Forms.Button(); … … 67 69 this.parametersTabPage.SuspendLayout(); 68 70 this.problemTabPage.SuspendLayout(); 71 this.resultsTabPage.SuspendLayout(); 69 72 this.SuspendLayout(); 70 73 // … … 73 76 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 74 77 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); 76 79 // 77 80 // descriptionTextBox … … 79 82 this.descriptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 80 83 | 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); 82 85 // 83 86 // tabControl … … 88 91 this.tabControl.Controls.Add(this.parametersTabPage); 89 92 this.tabControl.Controls.Add(this.problemTabPage); 93 this.tabControl.Controls.Add(this.resultsTabPage); 90 94 this.tabControl.Location = new System.Drawing.Point(0, 119); 91 95 this.tabControl.Name = "tabControl"; 92 96 this.tabControl.SelectedIndex = 0; 93 this.tabControl.Size = new System.Drawing.Size( 490, 204);97 this.tabControl.Size = new System.Drawing.Size(679, 333); 94 98 this.tabControl.TabIndex = 4; 95 99 // … … 126 130 this.problemTabPage.Name = "problemTabPage"; 127 131 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); 129 133 this.problemTabPage.TabIndex = 1; 130 134 this.problemTabPage.Text = "Problem"; … … 138 142 this.saveProblemButton.Size = new System.Drawing.Size(24, 24); 139 143 this.saveProblemButton.TabIndex = 2; 144 this.toolTip.SetToolTip(this.saveProblemButton, "Save Problem"); 140 145 this.saveProblemButton.UseVisualStyleBackColor = true; 141 146 this.saveProblemButton.Click += new System.EventHandler(this.saveProblemButton_Click); … … 148 153 this.openProblemButton.Size = new System.Drawing.Size(24, 24); 149 154 this.openProblemButton.TabIndex = 1; 155 this.toolTip.SetToolTip(this.openProblemButton, "Open Problem"); 150 156 this.openProblemButton.UseVisualStyleBackColor = true; 151 157 this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click); … … 158 164 this.newProblemButton.Size = new System.Drawing.Size(24, 24); 159 165 this.newProblemButton.TabIndex = 0; 166 this.toolTip.SetToolTip(this.newProblemButton, "New Problem"); 160 167 this.newProblemButton.UseVisualStyleBackColor = true; 161 168 this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click); … … 169 176 this.problemViewHost.Location = new System.Drawing.Point(6, 36); 170 177 this.problemViewHost.Name = "problemViewHost"; 171 this.problemViewHost.Size = new System.Drawing.Size( 470, 136);178 this.problemViewHost.Size = new System.Drawing.Size(659, 265); 172 179 this.problemViewHost.TabIndex = 3; 173 180 this.problemViewHost.ViewType = null; 174 181 // 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 // 175 205 // startButton 176 206 // 177 207 this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 178 208 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); 180 210 this.startButton.Name = "startButton"; 181 211 this.startButton.Size = new System.Drawing.Size(24, 24); 182 212 this.startButton.TabIndex = 5; 213 this.toolTip.SetToolTip(this.startButton, "Start Algorithm"); 183 214 this.startButton.UseVisualStyleBackColor = true; 184 215 this.startButton.Click += new System.EventHandler(this.startButton_Click); … … 188 219 this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 189 220 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); 191 222 this.stopButton.Name = "stopButton"; 192 223 this.stopButton.Size = new System.Drawing.Size(24, 24); 193 224 this.stopButton.TabIndex = 6; 225 this.toolTip.SetToolTip(this.stopButton, "Stop Algorithm"); 194 226 this.stopButton.UseVisualStyleBackColor = true; 195 227 this.stopButton.Click += new System.EventHandler(this.stopButton_Click); … … 199 231 this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 200 232 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); 202 234 this.resetButton.Name = "resetButton"; 203 235 this.resetButton.Size = new System.Drawing.Size(24, 24); 204 236 this.resetButton.TabIndex = 7; 237 this.toolTip.SetToolTip(this.resetButton, "Reset Algorithm"); 205 238 this.resetButton.UseVisualStyleBackColor = true; 206 239 this.resetButton.Click += new System.EventHandler(this.resetButton_Click); … … 210 243 this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 211 244 this.executionTimeLabel.AutoSize = true; 212 this.executionTimeLabel.Location = new System.Drawing.Point( 264, 336);245 this.executionTimeLabel.Location = new System.Drawing.Point(453, 465); 213 246 this.executionTimeLabel.Name = "executionTimeLabel"; 214 247 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13); … … 219 252 // 220 253 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); 222 255 this.executionTimeTextBox.Name = "executionTimeTextBox"; 223 256 this.executionTimeTextBox.ReadOnly = true; … … 251 284 this.Controls.Add(this.resetButton); 252 285 this.Name = "AlgorithmView"; 253 this.Size = new System.Drawing.Size( 490, 353);286 this.Size = new System.Drawing.Size(679, 482); 254 287 this.Controls.SetChildIndex(this.resetButton, 0); 255 288 this.Controls.SetChildIndex(this.executionTimeLabel, 0); … … 266 299 this.parametersTabPage.ResumeLayout(false); 267 300 this.problemTabPage.ResumeLayout(false); 301 this.resultsTabPage.ResumeLayout(false); 268 302 this.ResumeLayout(false); 269 303 this.PerformLayout(); … … 289 323 protected System.Windows.Forms.OpenFileDialog openFileDialog; 290 324 protected System.Windows.Forms.SaveFileDialog saveFileDialog; 325 protected System.Windows.Forms.TabPage resultsTabPage; 326 protected HeuristicLab.Core.Views.VariableCollectionView resultsView; 291 327 292 328 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r2852 r2882 82 82 parameterCollectionView.Content = null; 83 83 problemViewHost.Content = null; 84 resultsView.Content = null; 84 85 tabControl.Enabled = false; 85 86 startButton.Enabled = resetButton.Enabled = false; … … 90 91 saveProblemButton.Enabled = Content.Problem != null; 91 92 problemViewHost.Content = Content.Problem; 93 resultsView.Content = Content.Results; 92 94 tabControl.Enabled = true; 93 95 startButton.Enabled = !Content.Finished; … … 106 108 newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = true; 107 109 problemViewHost.Enabled = true; 110 resultsView.Content = Content.Results; 111 resultsView.Enabled = true; 108 112 startButton.Enabled = !Content.Finished; 109 113 stopButton.Enabled = false; … … 128 132 newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false; 129 133 problemViewHost.Enabled = false; 134 resultsView.Enabled = false; 130 135 startButton.Enabled = false; 131 136 stopButton.Enabled = true; … … 141 146 newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = true; 142 147 problemViewHost.Enabled = true; 148 resultsView.Enabled = true; 143 149 startButton.Enabled = !Content.Finished; 144 150 stopButton.Enabled = false; -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ProblemView.Designer.cs
r2851 r2882 52 52 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 53 53 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 54 this.nameTextBox.Size = new System.Drawing.Size(418, 20);55 //56 // descriptionTextBox57 //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);61 54 // 62 55 // ProblemView … … 65 58 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 66 59 this.Name = "ProblemView"; 67 this.Size = new System.Drawing.Size(490, 353);68 60 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 69 61 this.ResumeLayout(false); -
trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs
r2851 r2882 46 46 private void InitializeComponent() { 47 47 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(); 48 52 this.globalScopeTabPage = new System.Windows.Forms.TabPage(); 49 53 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();54 54 this.tabControl.SuspendLayout(); 55 55 this.parametersTabPage.SuspendLayout(); 56 56 this.problemTabPage.SuspendLayout(); 57 this.resultsTabPage.SuspendLayout(); 57 58 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 58 59 this.operatorGraphTabPage.SuspendLayout(); … … 60 61 this.SuspendLayout(); 61 62 // 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 // 62 71 // tabControl 63 72 // 64 73 this.tabControl.Controls.Add(this.operatorGraphTabPage); 65 74 this.tabControl.Controls.Add(this.globalScopeTabPage); 75 this.tabControl.Controls.SetChildIndex(this.resultsTabPage, 0); 66 76 this.tabControl.Controls.SetChildIndex(this.globalScopeTabPage, 0); 67 77 this.tabControl.Controls.SetChildIndex(this.operatorGraphTabPage, 0); 68 78 this.tabControl.Controls.SetChildIndex(this.problemTabPage, 0); 69 79 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); 70 112 // 71 113 // nameTextBox … … 82 124 this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22); 83 125 this.operatorGraphTabPage.Name = "operatorGraphTabPage"; 84 this.operatorGraphTabPage.Size = new System.Drawing.Size( 482, 148);126 this.operatorGraphTabPage.Size = new System.Drawing.Size(648, 252); 85 127 this.operatorGraphTabPage.TabIndex = 2; 86 128 this.operatorGraphTabPage.Text = "Operator Graph"; 87 129 this.operatorGraphTabPage.UseVisualStyleBackColor = true; 88 130 // 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 // 89 176 // globalScopeTabPage 90 177 // … … 92 179 this.globalScopeTabPage.Location = new System.Drawing.Point(4, 22); 93 180 this.globalScopeTabPage.Name = "globalScopeTabPage"; 94 this.globalScopeTabPage.Size = new System.Drawing.Size( 482, 148);181 this.globalScopeTabPage.Size = new System.Drawing.Size(648, 252); 95 182 this.globalScopeTabPage.TabIndex = 3; 96 183 this.globalScopeTabPage.Text = "Global Scope"; … … 106 193 this.globalScopeView.Location = new System.Drawing.Point(3, 3); 107 194 this.globalScopeView.Name = "globalScopeView"; 108 this.globalScopeView.Size = new System.Drawing.Size( 476, 142);195 this.globalScopeView.Size = new System.Drawing.Size(642, 246); 109 196 this.globalScopeView.TabIndex = 0; 110 //111 // operatorGraphViewHost112 //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 // newOperatorGraphButton124 //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 // openOperatorGraphButton134 //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 // saveOperatorGraphButton144 //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);152 197 // 153 198 // UserDefinedAlgorithmView … … 159 204 this.parametersTabPage.ResumeLayout(false); 160 205 this.problemTabPage.ResumeLayout(false); 206 this.resultsTabPage.ResumeLayout(false); 161 207 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 162 208 this.operatorGraphTabPage.ResumeLayout(false); -
trunk/sources/HeuristicLab.Optimization/3.3/Algorithm.cs
r2864 r2882 22 22 using System; 23 23 using System.Drawing; 24 using HeuristicLab.Collections; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 55 56 } 56 57 } 58 59 public abstract IObservableKeyedCollection<string, IVariable> Results { get; } 57 60 58 61 public abstract TimeSpan ExecutionTime { get; } -
trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs
r2864 r2882 21 21 22 22 using System; 23 using HeuristicLab.Collections; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 68 69 } 69 70 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 70 80 public override TimeSpan ExecutionTime { 71 81 get { … … 85 95 : base() { 86 96 globalScope = new Scope(); 97 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 87 98 OperatorGraph = new OperatorGraph(); 88 99 } … … 90 101 : base(name) { 91 102 globalScope = new Scope(); 103 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 92 104 OperatorGraph = new OperatorGraph(); 93 105 } … … 95 107 : base(name, parameters) { 96 108 globalScope = new Scope(); 109 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 97 110 OperatorGraph = new OperatorGraph(); 98 111 } … … 100 113 : base(name, description) { 101 114 globalScope = new Scope(); 115 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 102 116 OperatorGraph = new OperatorGraph(); 103 117 } … … 105 119 : base(name, description, parameters) { 106 120 globalScope = new Scope(); 121 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 107 122 OperatorGraph = new OperatorGraph(); 108 123 } … … 133 148 protected override void OnPrepared() { 134 149 globalScope.Clear(); 150 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 151 readOnlyResults = null; 152 135 153 if (engine != null) { 136 154 ExecutionContext context = null; -
trunk/sources/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r2865 r2882 52 52 <None Include="HeuristicLabOptimizationPlugin.cs.frame" /> 53 53 <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" /> 54 58 <Compile Include="Interfaces\IMultiObjectiveProblem.cs" /> 55 59 <Compile Include="Interfaces\IMultiObjectiveEvaluator.cs" /> -
trunk/sources/HeuristicLab.Optimization/3.3/Interfaces/IAlgorithm.cs
r2864 r2882 21 21 22 22 using System; 23 using HeuristicLab.Collections; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 31 32 Type ProblemType { get; } 32 33 IProblem Problem { get; set; } 34 IObservableKeyedCollection<string, IVariable> Results { get; } 33 35 TimeSpan ExecutionTime { get; } 34 36 bool Running { get; } -
trunk/sources/HeuristicLab.Routing.TSP.Views/3.3/TSPView.Designer.cs
r2834 r2882 52 52 // parameterCollectionView 53 53 // 54 this.parameterCollectionView.Size = new System.Drawing.Size( 490, 205);54 this.parameterCollectionView.Size = new System.Drawing.Size(529, 274); 55 55 // 56 56 // nameTextBox … … 58 58 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 59 59 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); 60 65 // 61 66 // openFileDialog … … 70 75 this.importButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 71 76 | System.Windows.Forms.AnchorStyles.Right))); 72 this.importButton.Location = new System.Drawing.Point(0, 3 30);77 this.importButton.Location = new System.Drawing.Point(0, 399); 73 78 this.importButton.Name = "importButton"; 74 this.importButton.Size = new System.Drawing.Size( 490, 23);79 this.importButton.Size = new System.Drawing.Size(529, 23); 75 80 this.importButton.TabIndex = 5; 76 81 this.importButton.Text = "&Import from TSPLIB"; … … 84 89 this.Controls.Add(this.importButton); 85 90 this.Name = "TSPView"; 91 this.Size = new System.Drawing.Size(529, 422); 86 92 this.Controls.SetChildIndex(this.importButton, 0); 87 93 this.Controls.SetChildIndex(this.parameterCollectionView, 0); -
trunk/sources/HeuristicLab.Routing.TSP/3.3/TSP.cs
r2865 r2882 101 101 EvaluatorParameter.Value = evaluator; 102 102 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 } 108 110 }); 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>()); 112 117 } 113 118 -
trunk/sources/HeuristicLab.SGA/3.3/SGA.cs
r2865 r2882 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.PluginInfrastructure; 31 32 32 33 namespace HeuristicLab.SGA { … … 42 43 private SGAOperator sgaOperator; 43 44 44 private ConstrainedValueParameter<ICrossover> CrossoverOperatorParameter {45 get { return ( ConstrainedValueParameter<ICrossover>)Parameters["CrossoverOperator"]; }45 private ValueParameter<IntData> PopulationSizeParameter { 46 get { return (ValueParameter<IntData>)Parameters["PopulationSize"]; } 46 47 } 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"]; } 49 59 } 50 60 … … 62 72 Parameters.Add(new ValueParameter<BoolData>("SetSeedRandomly", "True if the random seed should be set to a random value, otherwise false.", new BoolData(true))); 63 73 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.")); 65 76 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>("Mutat ionOperator", "The operator used to mutate solutions."));77 Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 67 78 Parameters.Add(new ValueParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.", new IntData(1))); 68 79 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); 69 83 70 84 RandomCreator randomCreator = new RandomCreator(); … … 83 97 populationCreator.Successor = sgaOperator; 84 98 85 sgaOperator.CrossoverOperatorParameter.ActualName = "CrossoverOperator"; 99 sgaOperator.SelectorParameter.ActualName = "Selector"; 100 sgaOperator.CrossoverParameter.ActualName = "Crossover"; 86 101 sgaOperator.ElitesParameter.ActualName = "Elites"; 87 102 sgaOperator.MaximumGenerationsParameter.ActualName = "MaximumGenerations"; 88 sgaOperator.Mutat ionOperatorParameter.ActualName = "MutationOperator";103 sgaOperator.MutatorParameter.ActualName = "Mutator"; 89 104 sgaOperator.MutationProbabilityParameter.ActualName = "MutationProbability"; 90 105 sgaOperator.RandomParameter.ActualName = "Random"; 106 sgaOperator.ResultsParameter.ActualName = "Results"; 91 107 92 108 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); 93 116 } 94 117 … … 98 121 clone.sgaOperator = (SGAOperator)cloner.Clone(sgaOperator); 99 122 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))); 100 130 } 101 131 … … 112 142 if (Problem.SolutionCreator is IStochasticOperator) ((IStochasticOperator)Problem.SolutionCreator).RandomParameter.ActualName = "Random"; 113 143 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"); 115 145 116 146 populationCreator.SolutionCreatorParameter.Value = Problem.SolutionCreator; 117 populationCreator. SolutionEvaluatorParameter.Value = Problem.Evaluator;147 populationCreator.EvaluatorParameter.Value = Problem.Evaluator; 118 148 sgaOperator.MaximizationParameter.Value = Problem.Maximization; 119 149 sgaOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 120 sgaOperator. SolutionEvaluatorParameter.Value = Problem.Evaluator;150 sgaOperator.EvaluatorParameter.Value = Problem.Evaluator; 121 151 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); 128 154 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); 135 162 136 163 base.OnProblemChanged(); … … 143 170 protected override void Problem_EvaluatorChanged(object sender, EventArgs e) { 144 171 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; 146 174 sgaOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 147 sgaOperator. SolutionEvaluatorParameter.Value = Problem.Evaluator;175 sgaOperator.EvaluatorParameter.Value = Problem.Evaluator; 148 176 base.Problem_EvaluatorChanged(sender, e); 149 177 } 150 178 private void Problem_MaximizationChanged(object sender, EventArgs e) { 151 179 sgaOperator.MaximizationParameter.Value = Problem.Maximization; 180 SelectorParameter.ValidValues.OfType<ISingleObjectiveSelector>().Select(x => x.MaximizationParameter.Value = Problem.Maximization); 152 181 } 153 182 } -
trunk/sources/HeuristicLab.SGA/3.3/SGAOperator.cs
r2834 r2882 35 35 [Creatable("Test")] 36 36 public class SGAOperator : AlgorithmOperator { 37 [Storable]38 private ProportionalSelector proportionalSelector;39 40 37 #region Parameter properties 41 38 public ValueLookupParameter<IRandom> RandomParameter { … … 48 45 get { return (SubScopesLookupParameter<DoubleData>)Parameters["Quality"]; } 49 46 } 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"]; } 52 52 } 53 53 public ValueLookupParameter<DoubleData> MutationProbabilityParameter { 54 54 get { return (ValueLookupParameter<DoubleData>)Parameters["MutationProbability"]; } 55 55 } 56 public ValueLookupParameter<IOperator> Mutat ionOperatorParameter {57 get { return (ValueLookupParameter<IOperator>)Parameters["Mutat ionOperator"]; }56 public ValueLookupParameter<IOperator> MutatorParameter { 57 get { return (ValueLookupParameter<IOperator>)Parameters["Mutator"]; } 58 58 } 59 public ValueLookupParameter<IOperator> SolutionEvaluatorParameter {60 get { return (ValueLookupParameter<IOperator>)Parameters[" SolutionEvaluator"]; }59 public ValueLookupParameter<IOperator> EvaluatorParameter { 60 get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; } 61 61 } 62 62 public ValueLookupParameter<IntData> ElitesParameter { … … 65 65 public ValueLookupParameter<IntData> MaximumGenerationsParameter { 66 66 get { return (ValueLookupParameter<IntData>)Parameters["MaximumGenerations"]; } 67 } 68 public ValueLookupParameter<VariableCollection> ResultsParameter { 69 get { return (ValueLookupParameter<VariableCollection>)Parameters["Results"]; } 67 70 } 68 71 private ScopeParameter CurrentScopeParameter { … … 81 84 Parameters.Add(new ValueLookupParameter<BoolData>("Maximization", "True if the problem is a maximization problem, otherwise false.")); 82 85 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.")); 84 88 Parameters.Add(new ValueLookupParameter<DoubleData>("MutationProbability", "The probability that the mutation operator is applied on a solution.")); 85 Parameters.Add(new ValueLookupParameter<IOperator>("Mutat ionOperator", "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.")); 87 91 Parameters.Add(new ValueLookupParameter<IntData>("Elites", "The numer of elite solutions which are kept in each generation.")); 88 92 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.")); 89 94 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the SGA should be applied.")); 90 95 #endregion … … 92 97 #region Create operator graph 93 98 SubScopesSorter subScopesSorter1 = new SubScopesSorter(); 94 proportionalSelector = new ProportionalSelector();99 Placeholder selector = new Placeholder(); 95 100 SequentialSubScopesProcessor sequentialSubScopesProcessor1 = new SequentialSubScopesProcessor(); 96 101 ChildrenCreator childrenCreator = new ChildrenCreator(); … … 108 113 IntCounter intCounter = new IntCounter(); 109 114 Comparator comparator = new Comparator(); 115 ResultsCollector resultsCollector = new ResultsCollector(); 110 116 ConditionalBranch conditionalBranch = new ConditionalBranch(); 111 117 … … 113 119 subScopesSorter1.ValueParameter.ActualName = "Quality"; 114 120 OperatorGraph.InitialOperator = subScopesSorter1; 115 subScopesSorter1.Successor = proportionalSelector;121 subScopesSorter1.Successor = selector; 116 122 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; 124 126 125 127 sequentialSubScopesProcessor1.Operators.Add(new EmptyOperator()); … … 133 135 uniformSequentialSubScopesProcessor.Successor = subScopesSorter2; 134 136 135 crossover.Name = "Crossover Operator";136 crossover.OperatorParameter.ActualName = "Crossover Operator";137 crossover.Name = "Crossover"; 138 crossover.OperatorParameter.ActualName = "Crossover"; 137 139 crossover.Successor = stochasticBranch; 138 140 … … 143 145 stochasticBranch.Successor = evaluator; 144 146 145 mutator.Name = "Mutat ionOperator";146 mutator.OperatorParameter.ActualName = "Mutat ionOperator";147 mutator.Name = "Mutator"; 148 mutator.OperatorParameter.ActualName = "Mutator"; 147 149 mutator.Successor = null; 148 150 149 evaluator.Name = " SolutionEvaluator";150 evaluator.OperatorParameter.ActualName = " SolutionEvaluator";151 evaluator.Name = "Evaluator"; 152 evaluator.OperatorParameter.ActualName = "Evaluator"; 151 153 evaluator.Successor = subScopesRemover; 152 154 … … 178 180 comparator.ResultParameter.ActualName = "Terminate"; 179 181 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; 181 189 182 190 conditionalBranch.ConditionParameter.ActualName = "Terminate"; … … 186 194 #endregion 187 195 } 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 reproduction198 proportionalSelector.NumberOfSelectedSubScopesParameter.Value = new IntData(2 * (populationSize - ElitesParameter.ActualValue.Value));199 return base.Apply();200 }201 196 } 202 197 } -
trunk/sources/HeuristicLab.Selection/3.3/HeuristicLab.Selection-3.3.csproj
r2817 r2882 119 119 <Name>HeuristicLab.Operators-3.3</Name> 120 120 </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> 121 125 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 122 126 <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project> -
trunk/sources/HeuristicLab.Selection/3.3/HeuristicLabSelectionPlugin.cs.frame
r2818 r2882 32 32 [PluginDependency("HeuristicLab.Data", "3.3")] 33 33 [PluginDependency("HeuristicLab.Operators", "3.3")] 34 [PluginDependency("HeuristicLab.Optimization", "3.3")] 34 35 [PluginDependency("HeuristicLab.Parameters", "3.3")] 35 36 [PluginDependency("HeuristicLab.Persistence", "3.3")] -
trunk/sources/HeuristicLab.Selection/3.3/Reducer.cs
r2834 r2882 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Operators; 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Parameters; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 32 33 [Item("Reducer", "A base class for reduction operators.")] 33 34 [EmptyStorableClass] 34 public abstract class Reducer : SingleSuccessorOperator {35 public abstract class Reducer : SingleSuccessorOperator, IReducer { 35 36 protected ScopeParameter CurrentScopeParameter { 36 37 get { return (ScopeParameter)Parameters["CurrentScope"]; } -
trunk/sources/HeuristicLab.Selection/3.3/Selector.cs
r2834 r2882 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Operators; 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 [Item("Selector", "A base class for selection operators.")] 34 35 [EmptyStorableClass] 35 public abstract class Selector : SingleSuccessorOperator {36 public abstract class Selector : SingleSuccessorOperator, ISelector { 36 37 protected ValueParameter<BoolData> CopySelectedParameter { 37 38 get { return (ValueParameter<BoolData>)Parameters["CopySelected"]; } 38 39 } 39 public ValueLookupParameter<IntData> NumberOfSelectedSubScopesParameter {40 public IValueLookupParameter<IntData> NumberOfSelectedSubScopesParameter { 40 41 get { return (ValueLookupParameter<IntData>)Parameters["NumberOfSelectedSubScopes"]; } 41 42 } -
trunk/sources/HeuristicLab.Selection/3.3/StochasticSelector.cs
r2818 r2882 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Optimization; 23 24 using HeuristicLab.Parameters; 24 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 30 31 [Item("StochasticSelector", "A base class for stochastic selection operators.")] 31 32 [EmptyStorableClass] 32 public abstract class StochasticSelector : Selector {33 public LookupParameter<IRandom> RandomParameter {33 public abstract class StochasticSelector : Selector, IStochasticOperator { 34 public ILookupParameter<IRandom> RandomParameter { 34 35 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 35 36 } -
trunk/sources/HeuristicLab.Selection/3.3/StochasticSingleObjectiveSelector.cs
r2818 r2882 22 22 using HeuristicLab.Core; 23 23 using HeuristicLab.Data; 24 using HeuristicLab.Optimization; 24 25 using HeuristicLab.Parameters; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 31 32 [Item("StochasticSingleObjectiveSelector", "A base class for stochastic selection operators which consider a single double quality value for selection.")] 32 33 [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"]; } 36 37 } 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"]; } 39 40 } 40 41 41 42 protected StochasticSingleObjectiveSelector() 42 43 : 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.")); 44 45 Parameters.Add(new SubScopesLookupParameter<DoubleData>("Quality", "The quality value contained in each sub-scope which is used for selection.")); 45 46 }
Note: See TracChangeset
for help on using the changeset viewer.