Changeset 4567
- Timestamp:
- 10/07/10 10:07:12 (14 years ago)
- Location:
- branches/HeuristicLab.Classification
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/CrossValidationView.Designer.cs
r4561 r4567 73 73 this.openAlgorithmButton = new System.Windows.Forms.Button(); 74 74 this.newAlgorithmButton = new System.Windows.Forms.Button(); 75 this.foldsTabPage = new System.Windows.Forms.TabPage(); 76 this.algorithmResultsCollectionView = new HeuristicLab.Algorithms.DataAnalysis.Views.AlgorithmResultsCollectionView(); 75 this.resultsTabPage = new System.Windows.Forms.TabPage(); 77 76 this.runsTabPage = new System.Windows.Forms.TabPage(); 78 77 this.storeAlgorithmInEachRunCheckBox = new System.Windows.Forms.CheckBox(); 79 78 this.runCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView(); 80 79 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 80 this.splitContainer = new System.Windows.Forms.SplitContainer(); 81 this.resultCollectionView = new HeuristicLab.Optimization.Views.ResultCollectionView(); 81 82 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 82 83 ((System.ComponentModel.ISupportInitialize)(this.foldsNumericUpDown)).BeginInit(); … … 87 88 this.algorithmProblemTabPage.SuspendLayout(); 88 89 this.algorithmParametersTabPage.SuspendLayout(); 89 this. foldsTabPage.SuspendLayout();90 this.resultsTabPage.SuspendLayout(); 90 91 this.runsTabPage.SuspendLayout(); 92 this.splitContainer.Panel1.SuspendLayout(); 93 this.splitContainer.Panel2.SuspendLayout(); 94 this.splitContainer.SuspendLayout(); 91 95 this.SuspendLayout(); 92 96 // … … 96 100 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 97 101 this.nameTextBox.Location = new System.Drawing.Point(80, 0); 98 this.nameTextBox.Size = new System.Drawing.Size(53 1, 20);102 this.nameTextBox.Size = new System.Drawing.Size(533, 20); 99 103 // 100 104 // descriptionTextBox 101 105 // 102 106 this.descriptionTextBox.Location = new System.Drawing.Point(80, 26); 103 this.descriptionTextBox.Size = new System.Drawing.Size(53 1, 20);107 this.descriptionTextBox.Size = new System.Drawing.Size(533, 20); 104 108 // 105 109 // startButton … … 150 154 // 151 155 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 152 this.executionTimeTextBox.Location = new System.Drawing.Point(47 6, 517);156 this.executionTimeTextBox.Location = new System.Drawing.Point(478, 517); 153 157 this.executionTimeTextBox.Name = "executionTimeTextBox"; 154 158 this.executionTimeTextBox.ReadOnly = true; … … 160 164 this.executionTimeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 161 165 this.executionTimeLabel.AutoSize = true; 162 this.executionTimeLabel.Location = new System.Drawing.Point(38 7, 520);166 this.executionTimeLabel.Location = new System.Drawing.Point(389, 520); 163 167 this.executionTimeLabel.Name = "executionTimeLabel"; 164 168 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13); … … 170 174 this.foldsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 171 175 | System.Windows.Forms.AnchorStyles.Right))); 172 this.foldsNumericUpDown.Location = new System.Drawing.Point( 389, 79);176 this.foldsNumericUpDown.Location = new System.Drawing.Point(55, 26); 173 177 this.foldsNumericUpDown.Maximum = new decimal(new int[] { 174 178 50, … … 182 186 0}); 183 187 this.foldsNumericUpDown.Name = "foldsNumericUpDown"; 184 this.foldsNumericUpDown.Size = new System.Drawing.Size(2 22, 20);188 this.foldsNumericUpDown.Size = new System.Drawing.Size(248, 20); 185 189 this.foldsNumericUpDown.TabIndex = 18; 186 190 this.foldsNumericUpDown.ThousandsSeparator = true; … … 196 200 // 197 201 this.foldsLabel.AutoSize = true; 198 this.foldsLabel.Location = new System.Drawing.Point(3 33, 80);202 this.foldsLabel.Location = new System.Drawing.Point(3, 29); 199 203 this.foldsLabel.Name = "foldsLabel"; 200 204 this.foldsLabel.Size = new System.Drawing.Size(35, 13); … … 206 210 this.workersNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 207 211 | System.Windows.Forms.AnchorStyles.Right))); 208 this.workersNumericUpDown.Location = new System.Drawing.Point( 389, 53);212 this.workersNumericUpDown.Location = new System.Drawing.Point(55, 0); 209 213 this.workersNumericUpDown.Maximum = new decimal(new int[] { 210 214 50, … … 218 222 0}); 219 223 this.workersNumericUpDown.Name = "workersNumericUpDown"; 220 this.workersNumericUpDown.Size = new System.Drawing.Size(2 22, 20);224 this.workersNumericUpDown.Size = new System.Drawing.Size(248, 20); 221 225 this.workersNumericUpDown.TabIndex = 20; 222 226 this.workersNumericUpDown.ThousandsSeparator = true; … … 232 236 // 233 237 this.workersLabel.AutoSize = true; 234 this.workersLabel.Location = new System.Drawing.Point(3 33, 55);238 this.workersLabel.Location = new System.Drawing.Point(3, 3); 235 239 this.workersLabel.Name = "workersLabel"; 236 240 this.workersLabel.Size = new System.Drawing.Size(50, 13); … … 241 245 // 242 246 this.samplesStartLabel.AutoSize = true; 243 this.samplesStartLabel.Location = new System.Drawing.Point(3, 55);247 this.samplesStartLabel.Location = new System.Drawing.Point(3, 3); 244 248 this.samplesStartLabel.Name = "samplesStartLabel"; 245 249 this.samplesStartLabel.Size = new System.Drawing.Size(75, 13); … … 250 254 // 251 255 this.samplesEndLabel.AutoSize = true; 252 this.samplesEndLabel.Location = new System.Drawing.Point(3, 80);256 this.samplesEndLabel.Location = new System.Drawing.Point(3, 29); 253 257 this.samplesEndLabel.Name = "samplesEndLabel"; 254 258 this.samplesEndLabel.Size = new System.Drawing.Size(72, 13); … … 258 262 // samplesEndStringConvertibleValueView 259 263 // 264 this.samplesEndStringConvertibleValueView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 265 | System.Windows.Forms.AnchorStyles.Right))); 260 266 this.samplesEndStringConvertibleValueView.Caption = "StringConvertibleValue View"; 261 267 this.samplesEndStringConvertibleValueView.Content = null; 262 268 this.samplesEndStringConvertibleValueView.LabelVisible = false; 263 this.samplesEndStringConvertibleValueView.Location = new System.Drawing.Point(80, 79);269 this.samplesEndStringConvertibleValueView.Location = new System.Drawing.Point(80, 26); 264 270 this.samplesEndStringConvertibleValueView.Name = "samplesEndStringConvertibleValueView"; 265 271 this.samplesEndStringConvertibleValueView.ReadOnly = false; 266 this.samplesEndStringConvertibleValueView.Size = new System.Drawing.Size(2 47, 18);272 this.samplesEndStringConvertibleValueView.Size = new System.Drawing.Size(223, 20); 267 273 this.samplesEndStringConvertibleValueView.TabIndex = 24; 268 274 // 269 275 // samplesStartStringConvertibleValueView 270 276 // 277 this.samplesStartStringConvertibleValueView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 278 | System.Windows.Forms.AnchorStyles.Right))); 271 279 this.samplesStartStringConvertibleValueView.Caption = "StringConvertibleValue View"; 272 280 this.samplesStartStringConvertibleValueView.Content = null; 273 281 this.samplesStartStringConvertibleValueView.LabelVisible = false; 274 this.samplesStartStringConvertibleValueView.Location = new System.Drawing.Point(80, 54);282 this.samplesStartStringConvertibleValueView.Location = new System.Drawing.Point(80, 0); 275 283 this.samplesStartStringConvertibleValueView.Name = "samplesStartStringConvertibleValueView"; 276 284 this.samplesStartStringConvertibleValueView.ReadOnly = false; 277 this.samplesStartStringConvertibleValueView.Size = new System.Drawing.Size(2 47, 18);285 this.samplesStartStringConvertibleValueView.Size = new System.Drawing.Size(223, 20); 278 286 this.samplesStartStringConvertibleValueView.TabIndex = 22; 279 287 // … … 284 292 | System.Windows.Forms.AnchorStyles.Right))); 285 293 this.tabControl.Controls.Add(this.algorithmTabPage); 286 this.tabControl.Controls.Add(this. foldsTabPage);294 this.tabControl.Controls.Add(this.resultsTabPage); 287 295 this.tabControl.Controls.Add(this.runsTabPage); 288 this.tabControl.Location = new System.Drawing.Point(0, 1 05);296 this.tabControl.Location = new System.Drawing.Point(0, 113); 289 297 this.tabControl.Name = "tabControl"; 290 298 this.tabControl.SelectedIndex = 0; 291 this.tabControl.Size = new System.Drawing.Size(61 4, 403);299 this.tabControl.Size = new System.Drawing.Size(616, 395); 292 300 this.tabControl.TabIndex = 25; 293 301 // … … 302 310 this.algorithmTabPage.Name = "algorithmTabPage"; 303 311 this.algorithmTabPage.Padding = new System.Windows.Forms.Padding(3); 304 this.algorithmTabPage.Size = new System.Drawing.Size(60 6, 377);312 this.algorithmTabPage.Size = new System.Drawing.Size(608, 369); 305 313 this.algorithmTabPage.TabIndex = 0; 306 314 this.algorithmTabPage.Text = "Algorithm"; … … 319 327 this.algorithmNamedItemView.Name = "algorithmNamedItemView"; 320 328 this.algorithmNamedItemView.ReadOnly = false; 321 this.algorithmNamedItemView.Size = new System.Drawing.Size(59 4, 52);329 this.algorithmNamedItemView.Size = new System.Drawing.Size(596, 52); 322 330 this.algorithmNamedItemView.TabIndex = 29; 323 331 // … … 332 340 this.algorithmTabControl.Name = "algorithmTabControl"; 333 341 this.algorithmTabControl.SelectedIndex = 0; 334 this.algorithmTabControl.Size = new System.Drawing.Size(59 2, 277);342 this.algorithmTabControl.Size = new System.Drawing.Size(594, 269); 335 343 this.algorithmTabControl.TabIndex = 28; 336 344 // … … 343 351 this.algorithmProblemTabPage.Name = "algorithmProblemTabPage"; 344 352 this.algorithmProblemTabPage.Padding = new System.Windows.Forms.Padding(3); 345 this.algorithmProblemTabPage.Size = new System.Drawing.Size(58 4, 251);353 this.algorithmProblemTabPage.Size = new System.Drawing.Size(586, 243); 346 354 this.algorithmProblemTabPage.TabIndex = 0; 347 355 this.algorithmProblemTabPage.Text = "Problem"; … … 373 381 this.algorithmProblemViewHost.Name = "algorithmProblemViewHost"; 374 382 this.algorithmProblemViewHost.ReadOnly = false; 375 this.algorithmProblemViewHost.Size = new System.Drawing.Size(57 2, 209);383 this.algorithmProblemViewHost.Size = new System.Drawing.Size(574, 201); 376 384 this.algorithmProblemViewHost.TabIndex = 0; 377 385 this.algorithmProblemViewHost.ViewType = null; … … 394 402 this.algorithmParametersTabPage.Name = "algorithmParametersTabPage"; 395 403 this.algorithmParametersTabPage.Padding = new System.Windows.Forms.Padding(3); 396 this.algorithmParametersTabPage.Size = new System.Drawing.Size(58 4, 251);404 this.algorithmParametersTabPage.Size = new System.Drawing.Size(586, 243); 397 405 this.algorithmParametersTabPage.TabIndex = 1; 398 406 this.algorithmParametersTabPage.Text = "Parameters"; … … 407 415 this.algorithmParameterCollectionView.Name = "algorithmParameterCollectionView"; 408 416 this.algorithmParameterCollectionView.ReadOnly = false; 409 this.algorithmParameterCollectionView.Size = new System.Drawing.Size(5 78, 245);417 this.algorithmParameterCollectionView.Size = new System.Drawing.Size(580, 237); 410 418 this.algorithmParameterCollectionView.TabIndex = 0; 411 419 // … … 432 440 this.newAlgorithmButton.Click += new System.EventHandler(this.newAlgorithmButton_Click); 433 441 // 434 // foldsTabPage 435 // 436 this.foldsTabPage.Controls.Add(this.algorithmResultsCollectionView); 437 this.foldsTabPage.Location = new System.Drawing.Point(4, 22); 438 this.foldsTabPage.Name = "foldsTabPage"; 439 this.foldsTabPage.Padding = new System.Windows.Forms.Padding(3); 440 this.foldsTabPage.Size = new System.Drawing.Size(606, 377); 441 this.foldsTabPage.TabIndex = 1; 442 this.foldsTabPage.Text = "Folds"; 443 this.foldsTabPage.UseVisualStyleBackColor = true; 444 // 445 // algorithmResultsCollectionView 446 // 447 this.algorithmResultsCollectionView.Caption = "View"; 448 this.algorithmResultsCollectionView.Content = null; 449 this.algorithmResultsCollectionView.Dock = System.Windows.Forms.DockStyle.Fill; 450 this.algorithmResultsCollectionView.Location = new System.Drawing.Point(3, 3); 451 this.algorithmResultsCollectionView.Name = "algorithmResultsCollectionView"; 452 this.algorithmResultsCollectionView.ReadOnly = true; 453 this.algorithmResultsCollectionView.Size = new System.Drawing.Size(600, 371); 454 this.algorithmResultsCollectionView.TabIndex = 0; 442 // resultsTabPage 443 // 444 this.resultsTabPage.Controls.Add(this.resultCollectionView); 445 this.resultsTabPage.Location = new System.Drawing.Point(4, 22); 446 this.resultsTabPage.Name = "resultsTabPage"; 447 this.resultsTabPage.Padding = new System.Windows.Forms.Padding(3); 448 this.resultsTabPage.Size = new System.Drawing.Size(608, 369); 449 this.resultsTabPage.TabIndex = 1; 450 this.resultsTabPage.Text = "Results"; 451 this.resultsTabPage.UseVisualStyleBackColor = true; 455 452 // 456 453 // runsTabPage … … 461 458 this.runsTabPage.Name = "runsTabPage"; 462 459 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 463 this.runsTabPage.Size = new System.Drawing.Size(60 6, 377);460 this.runsTabPage.Size = new System.Drawing.Size(608, 369); 464 461 this.runsTabPage.TabIndex = 2; 465 462 this.runsTabPage.Text = "Runs"; … … 490 487 this.runCollectionView.Name = "runCollectionView"; 491 488 this.runCollectionView.ReadOnly = false; 492 this.runCollectionView.Size = new System.Drawing.Size(60 0, 371);489 this.runCollectionView.Size = new System.Drawing.Size(602, 363); 493 490 this.runCollectionView.TabIndex = 3; 494 491 // … … 499 496 this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*"; 500 497 this.openFileDialog.Title = "Open Algorithm"; 498 // 499 // splitContainer 500 // 501 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 502 | System.Windows.Forms.AnchorStyles.Right))); 503 this.splitContainer.Location = new System.Drawing.Point(0, 52); 504 this.splitContainer.Name = "splitContainer"; 505 // 506 // splitContainer.Panel1 507 // 508 this.splitContainer.Panel1.Controls.Add(this.samplesEndStringConvertibleValueView); 509 this.splitContainer.Panel1.Controls.Add(this.samplesStartStringConvertibleValueView); 510 this.splitContainer.Panel1.Controls.Add(this.samplesStartLabel); 511 this.splitContainer.Panel1.Controls.Add(this.samplesEndLabel); 512 // 513 // splitContainer.Panel2 514 // 515 this.splitContainer.Panel2.Controls.Add(this.foldsNumericUpDown); 516 this.splitContainer.Panel2.Controls.Add(this.foldsLabel); 517 this.splitContainer.Panel2.Controls.Add(this.workersLabel); 518 this.splitContainer.Panel2.Controls.Add(this.workersNumericUpDown); 519 this.splitContainer.Size = new System.Drawing.Size(616, 55); 520 this.splitContainer.SplitterDistance = 306; 521 this.splitContainer.TabIndex = 26; 522 // 523 // resultCollectionView 524 // 525 this.resultCollectionView.Caption = "ResultCollection View"; 526 this.resultCollectionView.Content = null; 527 this.resultCollectionView.Dock = System.Windows.Forms.DockStyle.Fill; 528 this.resultCollectionView.Location = new System.Drawing.Point(3, 3); 529 this.resultCollectionView.Name = "resultCollectionView"; 530 this.resultCollectionView.ReadOnly = true; 531 this.resultCollectionView.Size = new System.Drawing.Size(602, 363); 532 this.resultCollectionView.TabIndex = 0; 501 533 // 502 534 // CrossValidationView … … 507 539 this.Controls.Add(this.executionTimeTextBox); 508 540 this.Controls.Add(this.executionTimeLabel); 509 this.Controls.Add(this.samplesStartStringConvertibleValueView);510 541 this.Controls.Add(this.startButton); 511 this.Controls.Add(this.workersNumericUpDown);512 this.Controls.Add(this.workersLabel);513 this.Controls.Add(this.samplesEndStringConvertibleValueView);514 this.Controls.Add(this.samplesEndLabel);515 542 this.Controls.Add(this.pauseButton); 516 this.Controls.Add(this.foldsNumericUpDown);517 this.Controls.Add(this.foldsLabel);518 this.Controls.Add(this.samplesStartLabel);519 543 this.Controls.Add(this.stopButton); 520 544 this.Controls.Add(this.resetButton); 545 this.Controls.Add(this.splitContainer); 521 546 this.Name = "CrossValidationView"; 522 this.Size = new System.Drawing.Size(614, 538); 547 this.Size = new System.Drawing.Size(616, 538); 548 this.Controls.SetChildIndex(this.splitContainer, 0); 523 549 this.Controls.SetChildIndex(this.resetButton, 0); 524 550 this.Controls.SetChildIndex(this.stopButton, 0); 525 this.Controls.SetChildIndex(this.samplesStartLabel, 0);526 this.Controls.SetChildIndex(this.foldsLabel, 0);527 this.Controls.SetChildIndex(this.foldsNumericUpDown, 0);528 551 this.Controls.SetChildIndex(this.pauseButton, 0); 529 this.Controls.SetChildIndex(this.samplesEndLabel, 0);530 this.Controls.SetChildIndex(this.samplesEndStringConvertibleValueView, 0);531 this.Controls.SetChildIndex(this.workersLabel, 0);532 this.Controls.SetChildIndex(this.workersNumericUpDown, 0);533 552 this.Controls.SetChildIndex(this.startButton, 0); 534 this.Controls.SetChildIndex(this.samplesStartStringConvertibleValueView, 0);535 553 this.Controls.SetChildIndex(this.executionTimeLabel, 0); 536 554 this.Controls.SetChildIndex(this.executionTimeTextBox, 0); … … 548 566 this.algorithmProblemTabPage.ResumeLayout(false); 549 567 this.algorithmParametersTabPage.ResumeLayout(false); 550 this. foldsTabPage.ResumeLayout(false);568 this.resultsTabPage.ResumeLayout(false); 551 569 this.runsTabPage.ResumeLayout(false); 552 570 this.runsTabPage.PerformLayout(); 571 this.splitContainer.Panel1.ResumeLayout(false); 572 this.splitContainer.Panel1.PerformLayout(); 573 this.splitContainer.Panel2.ResumeLayout(false); 574 this.splitContainer.Panel2.PerformLayout(); 575 this.splitContainer.ResumeLayout(false); 553 576 this.ResumeLayout(false); 554 577 this.PerformLayout(); … … 558 581 #endregion 559 582 560 private AlgorithmResultsCollectionView algorithmResultsCollectionView;561 583 private System.Windows.Forms.Button startButton; 562 584 private System.Windows.Forms.Button pauseButton; … … 575 597 private System.Windows.Forms.TabControl tabControl; 576 598 private System.Windows.Forms.TabPage algorithmTabPage; 577 private System.Windows.Forms.TabPage foldsTabPage;599 private System.Windows.Forms.TabPage resultsTabPage; 578 600 private System.Windows.Forms.Button openAlgorithmButton; 579 601 private System.Windows.Forms.Button newAlgorithmButton; … … 590 612 private Optimization.Views.RunCollectionView runCollectionView; 591 613 private System.Windows.Forms.CheckBox storeAlgorithmInEachRunCheckBox; 614 private System.Windows.Forms.SplitContainer splitContainer; 615 private Optimization.Views.ResultCollectionView resultCollectionView; 592 616 } 593 617 } -
branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis.Views/3.3/CrossValidationView.cs
r4563 r4567 50 50 base.OnContentChanged(); 51 51 if (Content == null) { 52 workersNumericUpDown.Value = 0;53 foldsNumericUpDown.Value = 0;52 workersNumericUpDown.Value = 1; 53 foldsNumericUpDown.Value = 2; 54 54 samplesStartStringConvertibleValueView.Content = null; 55 55 samplesEndStringConvertibleValueView.Content = null; … … 57 57 algorithmProblemViewHost.Content = null; 58 58 algorithmParameterCollectionView.Content = null; 59 algorithmResultsCollectionView.Content = null;59 resultCollectionView.Content = null; 60 60 runCollectionView.Content = null; 61 61 storeAlgorithmInEachRunCheckBox.Checked = true; … … 70 70 runCollectionView.Content = Content.Runs; 71 71 algorithmParameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters; 72 algorithmResultsCollectionView.Content = Content.ClonedAlgorithms;72 resultCollectionView.Content = Content.Results; 73 73 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 74 74 storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun; … … 349 349 } 350 350 #endregion 351 351 352 } 352 353 } -
branches/HeuristicLab.Classification/HeuristicLab.Algorithms.DataAnalysis/3.3/CrossValidation.cs
r4563 r4567 43 43 44 44 executionState = ExecutionState.Stopped; 45 executionTime = TimeSpan.Zero;46 45 runs = new RunCollection(); 47 46 runsCounter = 0; … … 73 72 public override IDeepCloneable Clone(Cloner cloner) { 74 73 CrossValidation clone = (CrossValidation)base.Clone(cloner); 75 clone.DeregisterEvents(); //not necessary76 74 clone.executionState = executionState; 77 clone.executionTime = executionTime;78 75 clone.storeAlgorithmInEachRun = storeAlgorithmInEachRun; 79 76 clone.runs = (RunCollection)cloner.Clone(runs); … … 88 85 return clone; 89 86 } 90 91 87 #endregion 92 88 … … 228 224 } 229 225 230 [Storable]231 private TimeSpan executionTime;232 226 public TimeSpan ExecutionTime { 233 227 get { 234 if (ExecutionState != ExecutionState.Stopped && ExecutionState != ExecutionState.Prepared) 235 return executionTime + TimeSpan.FromMilliseconds(clonedAlgorithms.Select(x => x.ExecutionTime.TotalMilliseconds).Sum()); 236 else 237 return executionTime; 238 } 239 private set { 240 executionTime = value; 241 OnExecutionTimeChanged(); 228 if (ExecutionState != ExecutionState.Prepared) 229 return TimeSpan.FromMilliseconds(clonedAlgorithms.Select(x => x.ExecutionTime.TotalMilliseconds).Sum()); 230 return TimeSpan.Zero; 242 231 } 243 232 } … … 247 236 if (ExecutionState == ExecutionState.Started) 248 237 throw new InvalidOperationException(string.Format("Prepare not allowed in execution state \"{0}\".", ExecutionState)); 238 results.Clear(); 249 239 clonedAlgorithms.Clear(); 250 240 if (Algorithm != null) { … … 357 347 results.Add(result.Name, result.Value); 358 348 359 results.Add("Execution Time", new TimeSpanValue( TimeSpan.FromMilliseconds(clonedAlgorithms.Select(x => x.ExecutionTime.TotalMilliseconds).Sum())));349 results.Add("Execution Time", new TimeSpanValue(this.ExecutionTime)); 360 350 results.Add("CrossValidation Folds", new RunCollection(runs)); 361 351 } … … 395 385 else throw new NotSupportedException("Could not convert any item type to double"); 396 386 } 397 398 387 #endregion 399 388 … … 404 393 SamplesEnd.ValueChanged += new EventHandler(SamplesEnd_ValueChanged); 405 394 RegisterClonedAlgorithmsEvents(); 406 RegisterRunsEvents();407 }408 private void DeregisterEvents() {409 Folds.ValueChanged -= new EventHandler(Folds_ValueChanged);410 SamplesStart.ValueChanged -= new EventHandler(SamplesStart_ValueChanged);411 SamplesEnd.ValueChanged -= new EventHandler(SamplesEnd_ValueChanged);412 DeregisterClonedAlgorithmsEvents();413 DeregisterRunsEvents();414 415 395 } 416 396 private void Folds_ValueChanged(object sender, EventArgs e) { … … 526 506 private void ClonedAlgorithm_Started(object sender, EventArgs e) { 527 507 lock (locker) { 508 IAlgorithm algorithm = sender as IAlgorithm; 509 if (algorithm != null && !results.ContainsKey(algorithm.Name)) 510 results.Add(new Result(algorithm.Name, "Contains results for the specific fold.", algorithm.Results)); 511 528 512 if (startPending) { 529 513 int startedAlgorithms = clonedAlgorithms.Count(alg => alg.ExecutionState == ExecutionState.Started); … … 563 547 } 564 548 #endregion 565 566 #region run events567 private void RegisterRunsEvents() {568 runs.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Runs_CollectionReset);569 runs.ItemsAdded += new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);570 runs.ItemsRemoved += new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsRemoved);571 }572 private void DeregisterRunsEvents() {573 runs.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Runs_CollectionReset);574 runs.ItemsAdded -= new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsAdded);575 runs.ItemsRemoved -= new CollectionItemsChangedEventHandler<IRun>(Runs_ItemsRemoved);576 }577 private void Runs_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) {578 foreach (IRun run in e.OldItems) {579 IItem item;580 run.Results.TryGetValue("Execution Time", out item);581 TimeSpanValue executionTime = item as TimeSpanValue;582 if (executionTime != null) ExecutionTime = this.executionTime - executionTime.Value;583 }584 foreach (IRun run in e.Items) {585 IItem item;586 run.Results.TryGetValue("Execution Time", out item);587 TimeSpanValue executionTime = item as TimeSpanValue;588 if (executionTime != null) ExecutionTime = this.executionTime + executionTime.Value;589 }590 runsCounter = Runs.Count;591 }592 private void Runs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) {593 foreach (IRun run in e.Items) {594 IItem item;595 run.Results.TryGetValue("Execution Time", out item);596 TimeSpanValue executionTime = item as TimeSpanValue;597 if (executionTime != null) this.executionTime = this.executionTime + executionTime.Value;598 }599 }600 private void Runs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) {601 foreach (IRun run in e.Items) {602 IItem item;603 run.Results.TryGetValue("Execution Time", out item);604 TimeSpanValue executionTime = item as TimeSpanValue;605 if (executionTime != null) ExecutionTime = this.executionTime - executionTime.Value;606 }607 }608 #endregion609 549 #endregion 610 550 … … 625 565 EventHandler handler = Prepared; 626 566 if (handler != null) handler(this, EventArgs.Empty); 567 OnExecutionTimeChanged(); 627 568 } 628 569 public event EventHandler Started; … … 643 584 private void OnStopped() { 644 585 stopPending = false; 586 Dictionary<string, IItem> collectedResults = new Dictionary<string, IItem>(); 587 CollectResultValues(collectedResults); 588 results.AddRange(collectedResults.Select(x => new Result(x.Key, x.Value)).Cast<IResult>().ToArray()); 645 589 runsCounter++; 646 590 runs.Add(new Run(string.Format("{0} Run {1}", Name, runsCounter), this));
Note: See TracChangeset
for help on using the changeset viewer.