Changeset 4068 for trunk/sources/HeuristicLab.Encodings.RealVectorEncoding
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3
- Files:
-
- 58 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/BoundsChecker.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Creators/UniformRandomRealVectorCreator.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; 26 using HeuristicLab.Operators;27 25 using HeuristicLab.Optimization; 28 using HeuristicLab.Parameters;29 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 27 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/AverageCrossover.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 25 … … 58 56 result[i] = avg / (double)parentsCount; 59 57 } 60 } catch (IndexOutOfRangeException) { 58 } 59 catch (IndexOutOfRangeException) { 61 60 throw new ArgumentException("AverageCrossover: The parents' vectors are of different length.", "parents"); 62 61 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/BlendAlphaBetaCrossover.cs
r3907 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; … … 138 137 if (QualityParameter.ActualValue == null || QualityParameter.ActualValue.Length != parents.Length) throw new InvalidOperationException("BlendAlphaBetaCrossover: Parameter " + QualityParameter.ActualName + " could not be found, or not in the same quantity as there are parents."); 139 138 if (AlphaParameter.ActualValue == null || BetaParameter.ActualValue == null) throw new InvalidOperationException("BlendAlphaBetaCrossover: Parameter " + AlphaParameter.ActualName + " or paramter " + BetaParameter.ActualName + " could not be found."); 140 139 141 140 ItemArray<DoubleValue> qualities = QualityParameter.ActualValue; 142 141 bool maximization = MaximizationParameter.ActualValue.Value; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/BlendAlphaCrossover.cs
r3909 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/DiscreteCrossover.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 using HeuristicLab.Parameters;27 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 25 … … 48 45 public static RealVector Apply(IRandom random, ItemArray<RealVector> parents) { 49 46 int length = parents[0].Length; 50 51 for (int i = 0; i < parents.Length; i++) { 52 if (parents[i].Length != length)47 48 for (int i = 0; i < parents.Length; i++) { 49 if (parents[i].Length != length) 53 50 throw new ArgumentException("DiscreteCrossover: The parents' vectors are of different length.", "parents"); 54 51 } 55 52 56 53 RealVector result = new RealVector(length); 57 54 for (int i = 0; i < length; i++) { 58 55 result[i] = parents[random.Next(parents.Length)][i]; 59 } 60 56 } 57 61 58 return result; 62 59 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/HeuristicCrossover.cs
r3659 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; … … 72 71 if (betterParent.Length != worseParent.Length) 73 72 throw new ArgumentException("HeuristicCrossover: the two parents are not of the same length"); 74 73 75 74 int length = betterParent.Length; 76 75 double[] result = new double[length]; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/LocalCrossover.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 25 … … 47 45 if (parent1.Length != parent2.Length) 48 46 throw new ArgumentException("LocalCrossover: the two parents are not of the same length"); 49 47 50 48 double factor; 51 49 int length = parent1.Length; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/RandomConvexCrossover.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 25 … … 47 45 if (parent1.Length != parent2.Length) 48 46 throw new ArgumentException("ERROR in RandomConvexCrossover: the two parents are not of the same length"); 49 47 50 48 int length = parent1.Length; 51 49 double[] result = new double[length]; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/SimulatedBinaryCrossover.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs
r3675 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 25 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/UniformAllPositionsArithmeticCrossover.cs
r3909 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; … … 82 81 /// <returns>The vector resulting from the crossover.</returns> 83 82 protected override RealVector Cross(IRandom random, ItemArray<RealVector> parents) { 84 83 if (parents.Length != 2) throw new ArgumentException("UniformAllPositionsArithmeticCrossover: There must be exactly two parents.", "parents"); 85 84 if (AlphaParameter.ActualValue == null) throw new InvalidOperationException("UniformAllPositionsArithmeticCrossover: Parameter " + AlphaParameter.ActualName + " could not be found."); 86 85 return Apply(random, parents[0], parents[1], AlphaParameter.ActualValue); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/UniformSomePositionsArithmeticCrossover.cs
r3909 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; … … 74 73 if (alpha.Value < 0 || alpha.Value > 1) throw new ArgumentException("UniformSomePositionsArithmeticCrossover: Parameter alpha must be in the range [0;1]", "alpha"); 75 74 if (probability.Value < 0 || probability.Value > 1) throw new ArgumentException("UniformSomePositionsArithmeticCrossover: Parameter probability must be in the range [0;1]", "probability"); 76 75 77 76 RealVector result = new RealVector(length); 78 77 for (int i = 0; i < length; i++) { … … 92 91 /// <param name="parents">The collection of parents (must be of size 2).</param> 93 92 /// <returns>The vector resulting from the crossover.</returns> 94 protected override RealVector 93 protected override RealVector Cross(IRandom random, ItemArray<RealVector> parents) { 95 94 if (parents.Length != 2) throw new ArgumentException("UniformSomePositionsArithmeticCrossover: There must be exactly two parents.", "parents"); 96 95 if (AlphaParameter.ActualValue == null) throw new InvalidOperationException("UniformSomePositionsArithmeticCrossover: Parameter " + AlphaParameter.ActualName + " could not be found."); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IAdditiveRealVectorMoveOperator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Optimization;25 23 26 24 namespace HeuristicLab.Encodings.RealVectorEncoding { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorBoundsChecker.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorCreator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorCrossover.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorManipulator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorMoveGenerator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorMoveOperator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 23 using HeuristicLab.Optimization; 26 24 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorOperator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorStdDevStrategyParameterCreator.cs
r3450 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorStdDevStrategyParameterCrossover.cs
r3450 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 23 using HeuristicLab.Optimization; 26 24 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorStdDevStrategyParameterManipulator.cs
r3450 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorStdDevStrategyParameterOperator.cs
r3450 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 using HeuristicLab.Core;24 using HeuristicLab.Optimization;25 22 26 23 namespace HeuristicLab.Encodings.RealVectorEncoding { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/BreederGeneticAlgorithmManipulator.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformAllPositionsManipulator.cs
r3750 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MichalewiczNonUniformOnePositionManipulator.cs
r3750 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/NormalAllPositionsManipulator.cs
r3691 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 24 using HeuristicLab.Optimization; 27 25 using HeuristicLab.Parameters; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialAllPositionManipulator.cs
r3450 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/PolynomialOnePositionManipulator.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs
r3376 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; 26 using HeuristicLab.Parameters;27 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 26 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs
r3520 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Common;24 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 25 24 using HeuristicLab.Operators; 26 25 using HeuristicLab.Optimization; 27 26 using HeuristicLab.Parameters; 28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using HeuristicLab.Data;30 28 31 29 namespace HeuristicLab.Encodings.RealVectorEncoding { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveMaker.cs
r3520 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Common;24 22 using HeuristicLab.Core; 25 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuChecker.cs
r3520 r4068 21 21 22 22 using System; 23 using HeuristicLab.Common;24 23 using HeuristicLab.Core; 25 24 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuMaker.cs
r3520 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Common;24 22 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 using HeuristicLab.Operators;27 using HeuristicLab.Optimization;28 23 using HeuristicLab.Optimization.Operators; 29 24 using HeuristicLab.Parameters; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticNormalMultiMoveGenerator.cs
r3376 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Common;24 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 24 using HeuristicLab.Optimization; 25 using HeuristicLab.Parameters; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Optimization;27 using HeuristicLab.Operators;28 using HeuristicLab.Parameters;29 using HeuristicLab.Data;30 27 using HeuristicLab.Random; 31 28 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/StochasticPolynomialMultiMoveGenerator.cs
r3376 r4068 20 20 #endregion 21 21 22 using System;23 using HeuristicLab.Common;24 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 24 using HeuristicLab.Optimization; 25 using HeuristicLab.Parameters; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Optimization;27 using HeuristicLab.Operators;28 using HeuristicLab.Parameters;29 using HeuristicLab.Data;30 27 31 28 namespace HeuristicLab.Encodings.RealVectorEncoding { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCreator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCrossover.cs
r3910 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorManipulator.cs
r3376 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorCreator.cs
r3450 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; … … 26 25 using HeuristicLab.Optimization; 27 26 using HeuristicLab.Parameters; 28 using HeuristicLab.Encodings.RealVectorEncoding;29 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 28 … … 54 52 Parameters.Add(new LookupParameter<RealVector>("StrategyParameter", "The crossed strategy parameter.")); 55 53 Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector.")); 56 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled.", new DoubleMatrix(new double[,] { { 0, 5} })));54 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled.", new DoubleMatrix(new double[,] { { 0, 5 } }))); 57 55 } 58 56 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorCrossover.cs
r3659 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Operators; 25 24 using HeuristicLab.Optimization; 26 25 using HeuristicLab.Parameters; 27 using HeuristicLab.Encodings.RealVectorEncoding;28 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 27 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/StrategyParameters/StdDevStrategyVectorManipulator.cs
r3520 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Common;22 using System; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 24 25 using HeuristicLab.Operators; 25 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 using HeuristicLab. Data;28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 29 using HeuristicLab.Random; 29 using System;30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;31 30 32 31 namespace HeuristicLab.Encodings.RealVectorEncoding { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/BlendAlphaBetaCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 22 24 using HeuristicLab.Encodings.RealVectorEncoding; 23 25 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 26 29 27 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 100 98 RealVector actual; 101 99 actual = target.Cross(random, parents); 102 } catch (System.ArgumentException) { 100 } 101 catch (System.ArgumentException) { 103 102 exceptionFired = true; 104 103 } … … 111 110 RealVector actual; 112 111 actual = target.Cross(random, parents); 113 } catch (System.ArgumentException) { 112 } 113 catch (System.ArgumentException) { 114 114 exceptionFired = true; 115 115 } … … 146 146 try { 147 147 actual = BlendAlphaBetaCrossover.Apply(random, parent1, parent2, alpha, beta); 148 } catch (System.ArgumentException) { 148 } 149 catch (System.ArgumentException) { 149 150 exceptionFired = true; 150 151 } … … 159 160 try { 160 161 actual = BlendAlphaBetaCrossover.Apply(random, parent1, parent2, alpha, beta); 161 } catch (System.ArgumentException) { 162 } 163 catch (System.ArgumentException) { 162 164 exceptionFired = true; 163 165 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/BlendAlphaCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 22 24 using HeuristicLab.Encodings.RealVectorEncoding; 23 25 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 26 29 27 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 100 98 RealVector actual; 101 99 actual = target.Cross(random, parents); 102 } catch (System.ArgumentException) { 100 } 101 catch (System.ArgumentException) { 103 102 exceptionFired = true; 104 103 } … … 111 110 RealVector actual; 112 111 actual = target.Cross(random, parents); 113 } catch (System.ArgumentException) { 112 } 113 catch (System.ArgumentException) { 114 114 exceptionFired = true; 115 115 } … … 154 154 try { 155 155 actual = BlendAlphaCrossover.Apply(random, parent1, parent2, alpha); 156 } catch (System.ArgumentException) { 156 } 157 catch (System.ArgumentException) { 157 158 exceptionFired = true; 158 159 } … … 168 169 try { 169 170 actual = BlendAlphaCrossover.Apply(random, parent1, parent2, alpha); 170 } catch (System.ArgumentException) { 171 } 172 catch (System.ArgumentException) { 171 173 exceptionFired = true; 172 174 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/DiscreteCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Encodings.RealVectorEncoding; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 25 29 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 100 97 RealVector actual; 101 98 actual = target.Cross(random, parents); 102 } catch (System.ArgumentException) { 99 } 100 catch (System.ArgumentException) { 103 101 exceptionFired = true; 104 102 } … … 120 118 parent1 = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 121 119 parent2 = new RealVector(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 }); 122 parents = new ItemArray<RealVector>( new RealVector[] { parent1, parent2 });120 parents = new ItemArray<RealVector>(new RealVector[] { parent1, parent2 }); 123 121 expected = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.8 }); 124 122 actual = DiscreteCrossover.Apply(random, parents); … … 133 131 try { 134 132 actual = DiscreteCrossover.Apply(random, parents); 135 } catch (System.ArgumentException) { 133 } 134 catch (System.ArgumentException) { 136 135 exceptionFired = true; 137 136 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/HeuristicCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Encodings.RealVectorEncoding; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 25 29 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 112 109 RealVector actual; 113 110 actual = target.Cross(random, parents); 114 } catch (System.ArgumentException) { 111 } 112 catch (System.ArgumentException) { 115 113 exceptionFired = true; 116 114 } … … 142 140 try { 143 141 actual = HeuristicCrossover.Apply(random, parent1, parent2); 144 } catch (System.ArgumentException) { 142 } 143 catch (System.ArgumentException) { 145 144 exceptionFired = true; 146 145 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/LocalCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Encodings.RealVectorEncoding; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 25 29 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 112 109 RealVector actual; 113 110 actual = target.Cross(random, parents); 114 } catch (System.ArgumentException) { 111 } 112 catch (System.ArgumentException) { 115 113 exceptionFired = true; 116 114 } … … 136 134 // The following test is not based on published examples 137 135 random.Reset(); 138 random.DoubleNumbers = new double[] { 0.3, 0.1, 0.2, 0.4, 0.23, 0.5 };136 random.DoubleNumbers = new double[] { 0.3, 0.1, 0.2, 0.4, 0.23, 0.5 }; 139 137 parent1 = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1, 0.9 }); // this parent is longer 140 138 parent2 = new RealVector(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 }); … … 142 140 try { 143 141 actual = LocalCrossover.Apply(random, parent1, parent2); 144 } catch (System.ArgumentException) { 142 } 143 catch (System.ArgumentException) { 145 144 exceptionFired = true; 146 145 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/MichalewiczNonUniformAllPositionsManipulatorTest.cs
r3123 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Data; 23 using HeuristicLab.Encodings.RealVectorEncoding; 22 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.RealVectorEncoding;24 using HeuristicLab.Data;25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/MichalewiczNonUniformOnePositionManipulatorTest.cs
r3123 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Data; 23 using HeuristicLab.Encodings.RealVectorEncoding; 22 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.RealVectorEncoding;24 using HeuristicLab.Data;25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/PolynomialAllPositionManipulatorTest.cs
r3061 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Data; 23 using HeuristicLab.Encodings.RealVectorEncoding; 22 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.RealVectorEncoding;24 using HeuristicLab.Data;25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/PolynomialOnePositionManipulatorTest.cs
r3061 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Data; 23 using HeuristicLab.Encodings.RealVectorEncoding; 22 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.RealVectorEncoding;24 using HeuristicLab.Data;25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/Properties/AssemblyInfo.cs
r3742 r4068 21 21 22 22 using System.Reflection; 23 using System.Runtime.CompilerServices;24 23 using System.Runtime.InteropServices; 25 24 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/RandomConvexCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Encodings.RealVectorEncoding; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 25 29 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 112 109 RealVector actual; 113 110 actual = target.Cross(random, parents); 114 } catch (System.ArgumentException) { 111 } 112 catch (System.ArgumentException) { 115 113 exceptionFired = true; 116 114 } … … 142 140 try { 143 141 actual = RandomConvexCrossover.Apply(random, parent1, parent2); 144 } catch (System.ArgumentException) { 142 } 143 catch (System.ArgumentException) { 145 144 exceptionFired = true; 146 145 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/SimulatedBinaryCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 22 24 using HeuristicLab.Encodings.RealVectorEncoding; 23 25 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 26 29 27 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 112 110 RealVector actual; 113 111 actual = target.Cross(random, parents); 114 } catch (System.ArgumentException) { 112 } 113 catch (System.ArgumentException) { 115 114 exceptionFired = true; 116 115 } … … 145 144 try { 146 145 actual = SimulatedBinaryCrossover.Apply(random, parent1, parent2, contiguity); 147 } catch (System.ArgumentException) { 146 } 147 catch (System.ArgumentException) { 148 148 exceptionFired = true; 149 149 } … … 153 153 random.DoubleNumbers = new double[] { 0.3, 0.9, 0.7, 0.2, 0.8, 0.1, 0.2, 0.3, 0.4, 0.8, 0.7 }; 154 154 contiguity = new DoubleValue(-0.3); // contiguity < 0 155 parent1 = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });155 parent1 = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 156 156 parent2 = new RealVector(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 }); 157 157 exceptionFired = false; -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/SinglePointCrossoverTest.cs
r3742 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Encodings.RealVectorEncoding; 23 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Common;25 using HeuristicLab.Core;26 using HeuristicLab.Data;27 using HeuristicLab.Parameters;28 25 29 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests { … … 112 109 RealVector actual; 113 110 actual = target.Cross(random, parents); 114 } catch (System.ArgumentException) { 111 } 112 catch (System.ArgumentException) { 115 113 exceptionFired = true; 116 114 } … … 123 121 RealVector actual; 124 122 actual = target.Cross(random, parents); 125 } catch (System.ArgumentException) { 123 } 124 catch (System.ArgumentException) { 126 125 exceptionFired = true; 127 126 } … … 153 152 try { 154 153 actual = SinglePointCrossover.Apply(random, parent1, parent2); 155 } catch (System.ArgumentException) { 154 } 155 catch (System.ArgumentException) { 156 156 exceptionFired = true; 157 157 } -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/UniformOnePositionManipulatorTest.cs
r3123 r4068 20 20 #endregion 21 21 22 using HeuristicLab.Data; 23 using HeuristicLab.Encodings.RealVectorEncoding; 22 24 using Microsoft.VisualStudio.TestTools.UnitTesting; 23 using HeuristicLab.Encodings.RealVectorEncoding;24 using HeuristicLab.Data;25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding_33.Tests {
Note: See TracChangeset
for help on using the changeset viewer.