- Timestamp:
- 07/26/17 15:48:32 (7 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/Async (added) merged: 13329,13349,13354-13355,13401,15065,15190,15204,15212,15215-15216,15232,15280-15281,15284,15286
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Tests
- Property svn:mergeinfo changed
/branches/Async/HeuristicLab.Tests (added) merged: 13355,13401,15065,15280-15281
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/GaussianProcessRegressionTest.cs
r14185 r15287 22 22 using System; 23 23 using System.Linq; 24 using System.Threading;25 24 using HeuristicLab.Common; 26 25 using HeuristicLab.Problems.DataAnalysis; … … 39 38 } 40 39 41 private EventWaitHandle trigger = new AutoResetEvent(false);42 40 private Exception ex; 43 41 … … 66 64 67 65 alg.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(cv_ExceptionOccurred); 68 alg.Stopped += new EventHandler(cv_Stopped);69 66 70 67 alg.Prepare(); 71 68 alg.Start(); 72 trigger.WaitOne();73 69 if (ex != null) throw ex; 74 70 … … 79 75 ex = e.Value; 80 76 } 81 82 private void cv_Stopped(object sender, EventArgs e) {83 trigger.Set();84 }85 77 } 86 78 } -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/GradientBoostingTest.cs
r13895 r15287 3 3 using System.IO; 4 4 using System.Linq; 5 using System.Threading;6 5 using HeuristicLab.Data; 7 using HeuristicLab.Optimization;8 6 using HeuristicLab.Problems.DataAnalysis; 9 7 using Microsoft.VisualStudio.TestTools.UnitTesting; … … 242 240 #endregion 243 241 244 RunAlgorithm(gbt);242 gbt.Start(); 245 243 246 244 Console.WriteLine(gbt.ExecutionTime); … … 270 268 #endregion 271 269 272 RunAlgorithm(gbt);270 gbt.Start(); 273 271 274 272 Console.WriteLine(gbt.ExecutionTime); … … 298 296 #endregion 299 297 300 RunAlgorithm(gbt);298 gbt.Start(); 301 299 302 300 Console.WriteLine(gbt.ExecutionTime); 303 301 Assert.AreEqual(0.061954221604374943, ((DoubleValue)gbt.Results["Loss (train)"].Value).Value, 1E-6); 304 302 Assert.AreEqual(0.06316303473499961, ((DoubleValue)gbt.Results["Loss (test)"].Value).Value, 1E-6); 305 }306 307 // same as in SamplesUtil308 private void RunAlgorithm(IAlgorithm a) {309 var trigger = new EventWaitHandle(false, EventResetMode.ManualReset);310 Exception ex = null;311 a.Stopped += (src, e) => { trigger.Set(); };312 a.ExceptionOccurred += (src, e) => { ex = e.Value; trigger.Set(); };313 a.Prepare();314 a.Start();315 trigger.WaitOne();316 317 Assert.AreEqual(ex, null);318 303 } 319 304 -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/SupportVectorMachineTest.cs
r14185 r15287 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Threading;26 25 using HeuristicLab.Algorithms.DataAnalysis; 27 26 using HeuristicLab.Common; … … 50 49 } 51 50 52 private EventWaitHandle trigger = new AutoResetEvent(false);53 51 private Exception ex; 54 52 … … 71 69 72 70 cv.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(cv_ExceptionOccurred); 73 cv.Stopped += new EventHandler(cv_Stopped);74 71 75 72 cv.Prepare(); 76 73 cv.Start(); 77 trigger.WaitOne();78 74 if (ex != null) throw ex; 79 75 … … 102 98 ex = e.Value; 103 99 } 104 105 private void cv_Stopped(object sender, EventArgs e) {106 trigger.Set();107 }108 100 } 109 101 }
Note: See TracChangeset
for help on using the changeset viewer.