Changeset 3048 for trunk/sources/HeuristicLab.Encodings.IntVector
- Timestamp:
- 03/15/10 23:49:54 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.IntVector/3.3
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Creators/UniformRandomIntVectorCreator.cs
r3032 r3048 43 43 /// <param name="max">The maximum value of the sampling range for each vector element (exclusive).</param> 44 44 /// <returns>The newly created integer vector.</returns> 45 public static IntArray DataApply(IRandom random, int length, int min, int max) {45 public static IntArray Apply(IRandom random, int length, int min, int max) { 46 46 int[] result = new int[length]; 47 47 for (int i = 0; i < length; i++) 48 48 result[i] = random.Next(min, max); 49 return new IntArray Data(result);49 return new IntArray(result); 50 50 } 51 51 … … 58 58 /// <param name="maximum">The maximum value of the sampling range for each vector element (exclusive).</param> 59 59 /// <returns>The newly created int vector.</returns> 60 protected override IntArray Data Create(IRandom random, IntData length, IntData minimum, IntDatamaximum) {60 protected override IntArray Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum) { 61 61 return Apply(random, length.Value, minimum.Value, maximum.Value); 62 62 } -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Crossovers/DiscreteCrossover.cs
r3032 r3048 45 45 /// <param name="parent2">The second parent for the crossover operation.</param> 46 46 /// <returns>The newly created integer vector, resulting from the crossover operation.</returns> 47 public static IntArray Data Apply(IRandom random, IntArrayData parent1, IntArrayDataparent2) {47 public static IntArray Apply(IRandom random, IntArray parent1, IntArray parent2) { 48 48 if(parent1.Length != parent2.Length) 49 49 throw new ArgumentException("DiscreteCrossover: The parents are of different length."); … … 58 58 result[i] = parent2[i]; 59 59 } 60 return new IntArray Data(result);60 return new IntArray(result); 61 61 } 62 62 … … 68 68 /// <param name="parents">An array containing the two integer vectors that should be crossed.</param> 69 69 /// <returns>The newly created integer vector, resulting from the crossover operation.</returns> 70 protected override IntArray Data Cross(IRandom random, ItemArray<IntArrayData> parents) {70 protected override IntArray Cross(IRandom random, ItemArray<IntArray> parents) { 71 71 if (parents.Length != 2) throw new ArgumentException("ERROR in DiscreteCrossover: The number of parents is not equal to 2"); 72 72 return Apply(random, parents[0], parents[1]); -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Crossovers/SinglePointCrossover.cs
r3032 r3048 45 45 /// <param name="parent2">The second parent for crossover.</param> 46 46 /// <returns>The newly created integer vector, resulting from the single point crossover.</returns> 47 public static IntArray Data Apply(IRandom random, IntArrayData parent1, IntArrayDataparent2) {47 public static IntArray Apply(IRandom random, IntArray parent1, IntArray parent2) { 48 48 if (parent1.Length != parent2.Length) 49 49 throw new ArgumentException("DiscreteCrossover: The parents are of different length."); … … 58 58 result[i] = parent2[i]; 59 59 60 return new IntArray Data(result);60 return new IntArray(result); 61 61 } 62 62 … … 69 69 /// <param name="parents">An array containing the two integer vectors that should be crossed.</param> 70 70 /// <returns>The newly created integer vector, resulting from the single point crossover.</returns> 71 protected override IntArray Data Cross(IRandom random, ItemArray<IntArrayData> parents) {71 protected override IntArray Cross(IRandom random, ItemArray<IntArray> parents) { 72 72 if (parents.Length != 2) throw new ArgumentException("ERROR in SinglePointCrossover: The number of parents is not equal to 2"); 73 73 return Apply(random, parents[0], parents[1]); -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/HeuristicLab.Encodings.IntVector-3.3.csproj
r3032 r3048 32 32 <ErrorReport>prompt</ErrorReport> 33 33 <WarningLevel>4</WarningLevel> 34 </PropertyGroup> 35 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 36 <DebugSymbols>true</DebugSymbols> 37 <OutputPath>bin\x64\Debug\</OutputPath> 38 <DefineConstants>DEBUG;TRACE</DefineConstants> 39 <DebugType>full</DebugType> 40 <PlatformTarget>x64</PlatformTarget> 41 <ErrorReport>prompt</ErrorReport> 42 </PropertyGroup> 43 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 44 <OutputPath>bin\x64\Release\</OutputPath> 45 <DefineConstants>TRACE</DefineConstants> 46 <Optimize>true</Optimize> 47 <DebugType>pdbonly</DebugType> 48 <PlatformTarget>x64</PlatformTarget> 49 <ErrorReport>prompt</ErrorReport> 50 </PropertyGroup> 51 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 52 <DebugSymbols>true</DebugSymbols> 53 <OutputPath>bin\x86\Debug\</OutputPath> 54 <DefineConstants>DEBUG;TRACE</DefineConstants> 55 <DebugType>full</DebugType> 56 <PlatformTarget>x86</PlatformTarget> 57 <ErrorReport>prompt</ErrorReport> 58 </PropertyGroup> 59 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 60 <OutputPath>bin\x86\Release\</OutputPath> 61 <DefineConstants>TRACE</DefineConstants> 62 <Optimize>true</Optimize> 63 <DebugType>pdbonly</DebugType> 64 <PlatformTarget>x86</PlatformTarget> 65 <ErrorReport>prompt</ErrorReport> 34 66 </PropertyGroup> 35 67 <ItemGroup> -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/IntVectorCreator.cs
r3032 r3048 37 37 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 38 38 } 39 public ILookupParameter<IntArray Data> IntVectorParameter {40 get { return (ILookupParameter<IntArray Data>)Parameters["IntVector"]; }39 public ILookupParameter<IntArray> IntVectorParameter { 40 get { return (ILookupParameter<IntArray>)Parameters["IntVector"]; } 41 41 } 42 public IValueLookupParameter<Int Data> LengthParameter {43 get { return (IValueLookupParameter<Int Data>)Parameters["Length"]; }42 public IValueLookupParameter<IntValue> LengthParameter { 43 get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; } 44 44 } 45 public IValueLookupParameter<Int Data> MinimumParameter {46 get { return (IValueLookupParameter<Int Data>)Parameters["Minimum"]; }45 public IValueLookupParameter<IntValue> MinimumParameter { 46 get { return (IValueLookupParameter<IntValue>)Parameters["Minimum"]; } 47 47 } 48 public IValueLookupParameter<Int Data> MaximumParameter {49 get { return (IValueLookupParameter<Int Data>)Parameters["Maximum"]; }48 public IValueLookupParameter<IntValue> MaximumParameter { 49 get { return (IValueLookupParameter<IntValue>)Parameters["Maximum"]; } 50 50 } 51 51 … … 53 53 : base() { 54 54 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 55 Parameters.Add(new LookupParameter<IntArray Data>("IntVector", "The vector which should be manipulated."));56 Parameters.Add(new ValueLookupParameter<Int Data>("Length", "The length of the vector."));57 Parameters.Add(new ValueLookupParameter<Int Data>("Minimum", "The lower bound for each element in the vector."));58 Parameters.Add(new ValueLookupParameter<Int Data>("Maximum", "The upper bound for each element in the vector."));55 Parameters.Add(new LookupParameter<IntArray>("IntVector", "The vector which should be manipulated.")); 56 Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector.")); 57 Parameters.Add(new ValueLookupParameter<IntValue>("Minimum", "The lower bound for each element in the vector.")); 58 Parameters.Add(new ValueLookupParameter<IntValue>("Maximum", "The upper bound for each element in the vector.")); 59 59 } 60 60 … … 64 64 } 65 65 66 protected abstract IntArray Data Create(IRandom random, IntData length, IntData minimum, IntDatamaximum);66 protected abstract IntArray Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum); 67 67 } 68 68 } -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/IntVectorCrossover.cs
r3032 r3048 37 37 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 38 38 } 39 public ILookupParameter<ItemArray<IntArray Data>> ParentsParameter {40 get { return (SubScopesLookupParameter<IntArray Data>)Parameters["Parents"]; }39 public ILookupParameter<ItemArray<IntArray>> ParentsParameter { 40 get { return (SubScopesLookupParameter<IntArray>)Parameters["Parents"]; } 41 41 } 42 public ILookupParameter<IntArray Data> ChildParameter {43 get { return (ILookupParameter<IntArray Data>)Parameters["Child"]; }42 public ILookupParameter<IntArray> ChildParameter { 43 get { return (ILookupParameter<IntArray>)Parameters["Child"]; } 44 44 } 45 45 … … 47 47 : base() { 48 48 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic crossover operators.")); 49 Parameters.Add(new SubScopesLookupParameter<IntArray Data>("Parents", "The parent vectors which should be crossed."));50 Parameters.Add(new LookupParameter<IntArray Data>("Child", "The child vector resulting from the crossover."));49 Parameters.Add(new SubScopesLookupParameter<IntArray>("Parents", "The parent vectors which should be crossed.")); 50 Parameters.Add(new LookupParameter<IntArray>("Child", "The child vector resulting from the crossover.")); 51 51 } 52 52 … … 56 56 } 57 57 58 protected abstract IntArray Data Cross(IRandom random, ItemArray<IntArrayData> parents);58 protected abstract IntArray Cross(IRandom random, ItemArray<IntArray> parents); 59 59 } 60 60 } -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/IntVectorManipulator.cs
r3032 r3048 37 37 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 38 38 } 39 public ILookupParameter<IntArray Data> IntVectorParameter {40 get { return (ILookupParameter<IntArray Data>)Parameters["IntVector"]; }39 public ILookupParameter<IntArray> IntVectorParameter { 40 get { return (ILookupParameter<IntArray>)Parameters["IntVector"]; } 41 41 } 42 42 … … 44 44 : base() { 45 45 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 46 Parameters.Add(new LookupParameter<IntArray Data>("IntVector", "The vector which should be manipulated."));46 Parameters.Add(new LookupParameter<IntArray>("IntVector", "The vector which should be manipulated.")); 47 47 } 48 48 … … 52 52 } 53 53 54 protected abstract void Manipulate(IRandom random, IntArray DataintVector);54 protected abstract void Manipulate(IRandom random, IntArray intVector); 55 55 } 56 56 } -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Interfaces/IIntVectorCreator.cs
r3032 r3048 29 29 /// </summary> 30 30 public interface IIntVectorCreator : IIntVectorOperator, ISolutionCreator { 31 IValueLookupParameter<Int Data> LengthParameter { get; }32 IValueLookupParameter<Int Data> MinimumParameter { get; }33 IValueLookupParameter<Int Data> MaximumParameter { get; }34 ILookupParameter<IntArray Data> IntVectorParameter { get; }31 IValueLookupParameter<IntValue> LengthParameter { get; } 32 IValueLookupParameter<IntValue> MinimumParameter { get; } 33 IValueLookupParameter<IntValue> MaximumParameter { get; } 34 ILookupParameter<IntArray> IntVectorParameter { get; } 35 35 } 36 36 } -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Interfaces/IIntVectorCrossover.cs
r3032 r3048 29 29 /// </summary> 30 30 public interface IIntVectorCrossover : IIntVectorOperator, ICrossover { 31 ILookupParameter<ItemArray<IntArray Data>> ParentsParameter { get; }32 ILookupParameter<IntArray Data> ChildParameter { get; }31 ILookupParameter<ItemArray<IntArray>> ParentsParameter { get; } 32 ILookupParameter<IntArray> ChildParameter { get; } 33 33 } 34 34 } -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Interfaces/IIntVectorManipulator.cs
r3032 r3048 29 29 /// </summary> 30 30 public interface IIntVectorManipulator : IIntVectorOperator, IManipulator { 31 ILookupParameter<IntArray Data> IntVectorParameter { get; }31 ILookupParameter<IntArray> IntVectorParameter { get; } 32 32 } 33 33 } -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Manipulators/UniformOnePositionManipulator.cs
r3032 r3048 42 42 /// The lower bound of the values in the int vector. 43 43 /// </summary> 44 public ValueLookupParameter<Int Data> MinimumParameter {45 get { return (ValueLookupParameter<Int Data>)Parameters["Minimum"]; }44 public ValueLookupParameter<IntValue> MinimumParameter { 45 get { return (ValueLookupParameter<IntValue>)Parameters["Minimum"]; } 46 46 } 47 47 /// <summary> 48 48 /// The upper bound of the values in the int vector. 49 49 /// </summary> 50 public ValueLookupParameter<Int Data> MaximumParameter {51 get { return (ValueLookupParameter<Int Data>)Parameters["Maximum"]; }50 public ValueLookupParameter<IntValue> MaximumParameter { 51 get { return (ValueLookupParameter<IntValue>)Parameters["Maximum"]; } 52 52 } 53 53 … … 57 57 /// </summary> 58 58 public UniformOnePositionManipulator() { 59 Parameters.Add(new ValueLookupParameter<Int Data>("Minimum", "Minimum of the sampling range for the vector element (included)"));60 Parameters.Add(new ValueLookupParameter<Int Data>("Maximum", "Maximum of the sampling range for the vector element (excluded)"));59 Parameters.Add(new ValueLookupParameter<IntValue>("Minimum", "Minimum of the sampling range for the vector element (included)")); 60 Parameters.Add(new ValueLookupParameter<IntValue>("Maximum", "Maximum of the sampling range for the vector element (excluded)")); 61 61 } 62 62 … … 70 70 /// <param name="max">The maximum value of the sampling range for 71 71 /// the vector element to change (exclusive).</param> 72 public static void Apply(IRandom random, IntArray Data vector, IntData min, IntDatamax) {72 public static void Apply(IRandom random, IntArray vector, IntValue min, IntValue max) { 73 73 int index = random.Next(vector.Length); 74 74 vector[index] = random.Next(min.Value, max.Value); … … 81 81 /// <param name="random">A random number generator.</param> 82 82 /// <param name="vector">The integer vector to manipulate.</param> 83 protected override void Manipulate(IRandom random, IntArray Datavector) {83 protected override void Manipulate(IRandom random, IntArray vector) { 84 84 if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found."); 85 85 if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found."); -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Tests/Auxiliary.cs
r3032 r3048 25 25 namespace HeuristicLab.Encodings.IntVector_33.Tests { 26 26 public static class Auxiliary { 27 public static bool IntVectorIsEqualByPosition(IntArray Data p1, IntArrayDatap2) {27 public static bool IntVectorIsEqualByPosition(IntArray p1, IntArray p2) { 28 28 bool equal = (p1.Length == p2.Length); 29 29 if (equal) { -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Tests/DiscreteCrossoverTest.cs
r3032 r3048 68 68 public void DiscreteCrossoverCrossTest() { 69 69 DiscreteCrossover_Accessor target = new DiscreteCrossover_Accessor(new PrivateObject(typeof(DiscreteCrossover))); 70 ItemArray<IntArray Data> parents;70 ItemArray<IntArray> parents; 71 71 TestRandom random = new TestRandom(); 72 72 bool exceptionFired; 73 73 // The following test checks if there is an exception when there are less than 2 parents 74 74 random.Reset(); 75 parents = new ItemArray<IntArray Data>(new IntArrayData[] { new IntArrayData(4) });75 parents = new ItemArray<IntArray>(new IntArray[] { new IntArray(4) }); 76 76 exceptionFired = false; 77 77 try { 78 IntArray Dataactual;78 IntArray actual; 79 79 actual = target.Cross(random, parents); 80 80 } catch (System.ArgumentException) { … … 90 90 public void DiscreteCrossoverApplyTest() { 91 91 TestRandom random = new TestRandom(); 92 IntArray Dataparent1, parent2, expected, actual;92 IntArray parent1, parent2, expected, actual; 93 93 bool exceptionFired; 94 94 // The following test is not based on published examples 95 95 random.Reset(); 96 96 random.DoubleNumbers = new double[] { 0, 0, 0.9, 0, 0.9 }; 97 parent1 = new IntArray Data(new int[] { 2, 2, 3, 5, 1 });98 parent2 = new IntArray Data(new int[] { 4, 1, 3, 2, 8 });99 expected = new IntArray Data(new int[] { 2, 2, 3, 5, 8 });97 parent1 = new IntArray(new int[] { 2, 2, 3, 5, 1 }); 98 parent2 = new IntArray(new int[] { 4, 1, 3, 2, 8 }); 99 expected = new IntArray(new int[] { 2, 2, 3, 5, 8 }); 100 100 actual = DiscreteCrossover.Apply(random, parent1, parent2); 101 101 Assert.IsTrue(Auxiliary.IntVectorIsEqualByPosition(actual, expected)); … … 104 104 random.Reset(); 105 105 random.DoubleNumbers = new double[] { 0, 0, 0.9, 0, 0.9 }; 106 parent1 = new IntArray Data(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer107 parent2 = new IntArray Data(new int[] { 4, 1, 3, 2, 8 });106 parent1 = new IntArray(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer 107 parent2 = new IntArray(new int[] { 4, 1, 3, 2, 8 }); 108 108 exceptionFired = false; 109 109 try { -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Tests/HeuristicLab.Encodings.IntVector-3.3.Tests.csproj
r3032 r3048 30 30 <ErrorReport>prompt</ErrorReport> 31 31 <WarningLevel>4</WarningLevel> 32 </PropertyGroup> 33 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> 34 <DebugSymbols>true</DebugSymbols> 35 <OutputPath>bin\x64\Debug\</OutputPath> 36 <DefineConstants>DEBUG;TRACE</DefineConstants> 37 <DebugType>full</DebugType> 38 <PlatformTarget>x64</PlatformTarget> 39 <ErrorReport>prompt</ErrorReport> 40 </PropertyGroup> 41 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> 42 <OutputPath>bin\x64\Release\</OutputPath> 43 <DefineConstants>TRACE</DefineConstants> 44 <Optimize>true</Optimize> 45 <DebugType>pdbonly</DebugType> 46 <PlatformTarget>x64</PlatformTarget> 47 <ErrorReport>prompt</ErrorReport> 48 </PropertyGroup> 49 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 50 <DebugSymbols>true</DebugSymbols> 51 <OutputPath>bin\x86\Debug\</OutputPath> 52 <DefineConstants>DEBUG;TRACE</DefineConstants> 53 <DebugType>full</DebugType> 54 <PlatformTarget>x86</PlatformTarget> 55 <ErrorReport>prompt</ErrorReport> 56 </PropertyGroup> 57 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> 58 <OutputPath>bin\x86\Release\</OutputPath> 59 <DefineConstants>TRACE</DefineConstants> 60 <Optimize>true</Optimize> 61 <DebugType>pdbonly</DebugType> 62 <PlatformTarget>x86</PlatformTarget> 63 <ErrorReport>prompt</ErrorReport> 32 64 </PropertyGroup> 33 65 <ItemGroup> -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Tests/SinglePointCrossoverTest.cs
r3032 r3048 68 68 public void SinglePointCrossoverCrossTest() { 69 69 SinglePointCrossover_Accessor target = new SinglePointCrossover_Accessor(new PrivateObject(typeof(SinglePointCrossover))); 70 ItemArray<IntArray Data> parents;70 ItemArray<IntArray> parents; 71 71 TestRandom random = new TestRandom(); 72 72 bool exceptionFired; 73 73 // The following test checks if there is an exception when there are more than 2 parents 74 74 random.Reset(); 75 parents = new ItemArray<IntArray Data>(new IntArrayData[] { new IntArrayData(5), new IntArrayData(6), new IntArrayData(4) });75 parents = new ItemArray<IntArray>(new IntArray[] { new IntArray(5), new IntArray(6), new IntArray(4) }); 76 76 exceptionFired = false; 77 77 try { 78 IntArray Dataactual;78 IntArray actual; 79 79 actual = target.Cross(random, parents); 80 80 } … … 85 85 // The following test checks if there is an exception when there are less than 2 parents 86 86 random.Reset(); 87 parents = new ItemArray<IntArray Data>(new IntArrayData[] { new IntArrayData(4) });87 parents = new ItemArray<IntArray>(new IntArray[] { new IntArray(4) }); 88 88 exceptionFired = false; 89 89 try { 90 IntArray Dataactual;90 IntArray actual; 91 91 actual = target.Cross(random, parents); 92 92 } catch (System.ArgumentException) { … … 102 102 public void SinglePointCrossoverApplyTest() { 103 103 TestRandom random = new TestRandom(); 104 IntArray Dataparent1, parent2, expected, actual;104 IntArray parent1, parent2, expected, actual; 105 105 bool exceptionFired; 106 106 // The following test is not based on published examples 107 107 random.Reset(); 108 108 random.IntNumbers = new int[] { 3 }; 109 parent1 = new IntArray Data(new int[] { 2, 2, 3, 5, 1 });110 parent2 = new IntArray Data(new int[] { 4, 1, 3, 2, 8 });111 expected = new IntArray Data(new int[] { 2, 2, 3, 2, 8 });109 parent1 = new IntArray(new int[] { 2, 2, 3, 5, 1 }); 110 parent2 = new IntArray(new int[] { 4, 1, 3, 2, 8 }); 111 expected = new IntArray(new int[] { 2, 2, 3, 2, 8 }); 112 112 actual = SinglePointCrossover.Apply(random, parent1, parent2); 113 113 Assert.IsTrue(Auxiliary.IntVectorIsEqualByPosition(actual, expected)); … … 115 115 random.Reset(); 116 116 random.IntNumbers = new int[] { 2 }; 117 parent1 = new IntArray Data(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer118 parent2 = new IntArray Data(new int[] { 4, 1, 3, 2, 8 });117 parent1 = new IntArray(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer 118 parent2 = new IntArray(new int[] { 4, 1, 3, 2, 8 }); 119 119 exceptionFired = false; 120 120 try { -
trunk/sources/HeuristicLab.Encodings.IntVector/3.3/Tests/UniformOnePositionManipulatorTest.cs
r3032 r3048 85 85 public void UniformOnePositionManipulatorApplyTest() { 86 86 TestRandom random = new TestRandom(); 87 IntArray Dataparent, expected;88 Int Datamin, max;87 IntArray parent, expected; 88 IntValue min, max; 89 89 // The following test is not based on published examples 90 90 random.Reset(); 91 91 random.IntNumbers = new int[] { 3, 3 }; 92 parent = new IntArray Data(new int[] { 2, 2, 3, 5, 1 });93 expected = new IntArray Data(new int[] { 2, 2, 3, 3, 1 });94 min = new Int Data(2);95 max = new Int Data(7);92 parent = new IntArray(new int[] { 2, 2, 3, 5, 1 }); 93 expected = new IntArray(new int[] { 2, 2, 3, 3, 1 }); 94 min = new IntValue(2); 95 max = new IntValue(7); 96 96 UniformOnePositionManipulator.Apply(random, parent, min, max); 97 97 Assert.IsTrue(Auxiliary.IntVectorIsEqualByPosition(expected, parent));
Note: See TracChangeset
for help on using the changeset viewer.