Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3059 for trunk/sources


Ignore:
Timestamp:
03/16/10 10:35:28 (14 years ago)
Author:
svonolfe
Message:

Updated the IntegerVector project to use the new solution encodings (#909)

Location:
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3
Files:
7 edited
8 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Creators/UniformRandomIntegerVectorCreator.cs

    r3054 r3059  
    3131  /// Generates a new random integer vector with each element uniformly distributed in a specified range.
    3232  /// </summary>
    33   [Item("UniformRandomIntVectorCreator", "An operator which creates a new random int vector with each element uniformly distributed in a specified range.")]
     33  [Item("UniformRandomIntegerVectorCreator", "An operator which creates a new random int vector with each element uniformly distributed in a specified range.")]
    3434  [StorableClass]
    3535  [Creatable("Test")]
    36   public class UniformRandomIntVectorCreator : IntVectorCreator {
     36  public class UniformRandomIntegerVectorCreator : IntegerVectorCreator {
    3737    /// <summary>
    3838    /// Generates a new random integer vector with the given <paramref name="length"/>.
     
    4343    /// <param name="max">The maximum value of the sampling range for each vector element (exclusive).</param>
    4444    /// <returns>The newly created integer vector.</returns>
    45     public static IntArray Apply(IRandom random, int length, int min, int max) {
     45    public static IntegerVector Apply(IRandom random, int length, int min, int max) {
    4646      int[] result = new int[length];
    4747      for (int i = 0; i < length; i++)
    4848        result[i] = random.Next(min, max);
    49       return new IntArray(result);
     49      return new IntegerVector(result);
    5050    }
    5151
     
    5858    /// <param name="maximum">The maximum value of the sampling range for each vector element (exclusive).</param>
    5959    /// <returns>The newly created int vector.</returns>
    60     protected override IntArray Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum) {
     60    protected override IntegerVector Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum) {
    6161      return Apply(random, length.Value, minimum.Value, maximum.Value);
    6262    }
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/DiscreteCrossover.cs

    r3053 r3059  
    3636  [Item("DiscreteCrossover", "Discrete crossover for integer vectors. It is implemented as described in Gwiazda, T.D. 2006. Genetic algorithms reference Volume I Crossover for single-objective numerical optimization problems, p.17.")]
    3737  [StorableClass]
    38   public class DiscreteCrossover : IntVectorCrossover {
     38  public class DiscreteCrossover : IntegerVectorCrossover {
    3939    /// <summary>
    4040    /// Performs a discrete crossover operation of the two given parents.
     
    4545    /// <param name="parent2">The second parent for the crossover operation.</param>
    4646    /// <returns>The newly created integer vector, resulting from the crossover operation.</returns>
    47     public static IntArray Apply(IRandom random, IntArray parent1, IntArray parent2) {
     47    public static IntegerVector Apply(IRandom random, IntegerVector parent1, IntegerVector parent2) {
    4848      if(parent1.Length != parent2.Length)
    4949        throw new ArgumentException("DiscreteCrossover: The parents are of different length.");
     
    5858          result[i] = parent2[i];
    5959      }
    60       return new IntArray(result);
     60      return new IntegerVector(result);
    6161    }
    6262
     
    6868    /// <param name="parents">An array containing the two integer vectors that should be crossed.</param>
    6969    /// <returns>The newly created integer vector, resulting from the crossover operation.</returns>
    70     protected override IntArray Cross(IRandom random, ItemArray<IntArray> parents) {
     70    protected override IntegerVector Cross(IRandom random, ItemArray<IntegerVector> parents) {
    7171      if (parents.Length != 2) throw new ArgumentException("ERROR in DiscreteCrossover: The number of parents is not equal to 2");
    7272      return Apply(random, parents[0], parents[1]);
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs

    r3053 r3059  
    3636  [Item("SinglePointCrossover", "Single point crossover for integer vectors. It is implemented as described in Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg.")]
    3737  [StorableClass]
    38   public class SinglePointCrossover : IntVectorCrossover {
     38  public class SinglePointCrossover : IntegerVectorCrossover {
    3939    /// <summary>
    4040    /// Performs a single point crossover at a randomly chosen position of the two
     
    4545    /// <param name="parent2">The second parent for crossover.</param>
    4646    /// <returns>The newly created integer vector, resulting from the single point crossover.</returns>
    47     public static IntArray Apply(IRandom random, IntArray parent1, IntArray parent2) {
     47    public static IntegerVector Apply(IRandom random, IntegerVector parent1, IntegerVector parent2) {
    4848      if (parent1.Length != parent2.Length)
    4949        throw new ArgumentException("DiscreteCrossover: The parents are of different length.");
     
    5858        result[i] = parent2[i];
    5959
    60       return new IntArray(result);
     60      return new IntegerVector(result);
    6161    }
    6262
     
    6969    /// <param name="parents">An array containing the two integer vectors that should be crossed.</param>
    7070    /// <returns>The newly created integer vector, resulting from the single point crossover.</returns>
    71     protected override IntArray Cross(IRandom random, ItemArray<IntArray> parents) {
     71    protected override IntegerVector Cross(IRandom random, ItemArray<IntegerVector> parents) {
    7272      if (parents.Length != 2) throw new ArgumentException("ERROR in SinglePointCrossover: The number of parents is not equal to 2");
    7373      return Apply(random, parents[0], parents[1]);
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/HeuristicLab.Encodings.IntegerVectorEncoding-3.3.csproj

    r3054 r3059  
    7979  </ItemGroup>
    8080  <ItemGroup>
    81     <Compile Include="Creators\UniformRandomIntVectorCreator.cs" />
     81    <Compile Include="Creators\UniformRandomIntegerVectorCreator.cs" />
    8282    <Compile Include="Crossovers\DiscreteCrossover.cs">
    8383      <SubType>Code</SubType>
     
    8787    </Compile>
    8888    <Compile Include="HeuristicLabEncodingsIntegerVectorEncodingPlugin.cs" />
    89     <Compile Include="Interfaces\IIntVectorCreator.cs" />
    90     <Compile Include="Interfaces\IIntVectorCrossover.cs" />
    91     <Compile Include="Interfaces\IIntVectorManipulator.cs" />
    92     <Compile Include="Interfaces\IIntVectorOperator.cs" />
    93     <Compile Include="IntVectorCrossover.cs" />
    94     <Compile Include="IntVectorManipulator.cs" />
     89    <Compile Include="Interfaces\IIntegerVectorCreator.cs" />
     90    <Compile Include="Interfaces\IIntegerVectorCrossover.cs" />
     91    <Compile Include="Interfaces\IIntegerVectorManipulator.cs" />
     92    <Compile Include="Interfaces\IIntegerVectorOperator.cs" />
     93    <Compile Include="IntegerVectorCrossover.cs" />
     94    <Compile Include="IntegerVectorManipulator.cs" />
    9595    <Compile Include="Manipulators\UniformOnePositionManipulator.cs">
    9696      <SubType>Code</SubType>
     
    9898    <Compile Include="IntegerVector.cs" />
    9999    <Compile Include="Properties\AssemblyInfo.cs" />
    100     <Compile Include="IntVectorCreator.cs" />
     100    <Compile Include="IntegerVectorCreator.cs" />
    101101  </ItemGroup>
    102102  <ItemGroup>
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCreator.cs

    r3054 r3059  
    3131  /// A base class for operators creating int-valued vectors.
    3232  /// </summary>
    33   [Item("IntVectorCreator", "A base class for operators creating int-valued vectors.")]
     33  [Item("IntegerVectorCreator", "A base class for operators creating int-valued vectors.")]
    3434  [StorableClass]
    35   public abstract class IntVectorCreator : SingleSuccessorOperator, IIntVectorCreator, IStochasticOperator {
     35  public abstract class IntegerVectorCreator : SingleSuccessorOperator, IIntegerVectorCreator, IStochasticOperator {
    3636    public ILookupParameter<IRandom> RandomParameter {
    3737      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    3838    }
    39     public ILookupParameter<IntArray> IntVectorParameter {
    40       get { return (ILookupParameter<IntArray>)Parameters["IntVector"]; }
     39    public ILookupParameter<IntegerVector> IntegerVectorParameter {
     40      get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; }
    4141    }
    4242    public IValueLookupParameter<IntValue> LengthParameter {
     
    5050    }
    5151
    52     protected IntVectorCreator()
     52    protected IntegerVectorCreator()
    5353      : base() {
    5454      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>("IntVector", "The vector which should be manipulated."));
     55      Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The vector which should be manipulated."));
    5656      Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector."));
    5757      Parameters.Add(new ValueLookupParameter<IntValue>("Minimum", "The lower bound for each element in the vector."));
     
    6060
    6161    public sealed override IOperation Apply() {
    62       IntVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, MinimumParameter.ActualValue, MaximumParameter.ActualValue);
     62      IntegerVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, MinimumParameter.ActualValue, MaximumParameter.ActualValue);
    6363      return base.Apply();
    6464    }
    6565
    66     protected abstract IntArray Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum);
     66    protected abstract IntegerVector Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum);
    6767  }
    6868}
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCrossover.cs

    r3054 r3059  
    3131  /// A base class for operators that perform a crossover of int-valued vectors.
    3232  /// </summary>
    33   [Item("IntVectorCrossover", "A base class for operators that perform a crossover of int-valued vectors.")]
     33  [Item("IntegerVectorCrossover", "A base class for operators that perform a crossover of int-valued vectors.")]
    3434  [StorableClass]
    35   public abstract class IntVectorCrossover : SingleSuccessorOperator, IIntVectorCrossover, IStochasticOperator {
     35  public abstract class IntegerVectorCrossover : SingleSuccessorOperator, IIntegerVectorCrossover, IStochasticOperator {
    3636    public ILookupParameter<IRandom> RandomParameter {
    3737      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    3838    }
    39     public ILookupParameter<ItemArray<IntArray>> ParentsParameter {
    40       get { return (SubScopesLookupParameter<IntArray>)Parameters["Parents"]; }
     39    public ILookupParameter<ItemArray<IntegerVector>> ParentsParameter {
     40      get { return (SubScopesLookupParameter<IntegerVector>)Parameters["Parents"]; }
    4141    }
    42     public ILookupParameter<IntArray> ChildParameter {
    43       get { return (ILookupParameter<IntArray>)Parameters["Child"]; }
     42    public ILookupParameter<IntegerVector> ChildParameter {
     43      get { return (ILookupParameter<IntegerVector>)Parameters["Child"]; }
    4444    }
    4545
    46     protected IntVectorCrossover()
     46    protected IntegerVectorCrossover()
    4747      : base() {
    4848      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>("Parents", "The parent vectors which should be crossed."));
    50       Parameters.Add(new LookupParameter<IntArray>("Child", "The child vector resulting from the crossover."));
     49      Parameters.Add(new SubScopesLookupParameter<IntegerVector>("Parents", "The parent vectors which should be crossed."));
     50      Parameters.Add(new LookupParameter<IntegerVector>("Child", "The child vector resulting from the crossover."));
    5151    }
    5252
     
    5656    }
    5757
    58     protected abstract IntArray Cross(IRandom random, ItemArray<IntArray> parents);
     58    protected abstract IntegerVector Cross(IRandom random, ItemArray<IntegerVector> parents);
    5959  }
    6060}
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorManipulator.cs

    r3054 r3059  
    3131  /// A base class for operators that manipulate int-valued vectors.
    3232  /// </summary>
    33   [Item("IntVectorManipulator", "A base class for operators that manipulate int-valued vectors.")]
     33  [Item("IntegerVectorManipulator", "A base class for operators that manipulate int-valued vectors.")]
    3434  [StorableClass]
    35   public abstract class IntVectorManipulator : SingleSuccessorOperator, IIntVectorManipulator, IStochasticOperator {
     35  public abstract class IntegerVectorManipulator : SingleSuccessorOperator, IIntegerVectorManipulator, IStochasticOperator {
    3636    public ILookupParameter<IRandom> RandomParameter {
    3737      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
    3838    }
    39     public ILookupParameter<IntArray> IntVectorParameter {
    40       get { return (ILookupParameter<IntArray>)Parameters["IntVector"]; }
     39    public ILookupParameter<IntegerVector> IntegerVectorParameter {
     40      get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; }
    4141    }
    4242
    43     protected IntVectorManipulator()
     43    protected IntegerVectorManipulator()
    4444      : base() {
    4545      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>("IntVector", "The vector which should be manipulated."));
     46      Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The vector which should be manipulated."));
    4747    }
    4848
    4949    public sealed override IOperation Apply() {
    50       Manipulate(RandomParameter.ActualValue, IntVectorParameter.ActualValue);
     50      Manipulate(RandomParameter.ActualValue, IntegerVectorParameter.ActualValue);
    5151      return base.Apply();
    5252    }
    5353
    54     protected abstract void Manipulate(IRandom random, IntArray intVector);
     54    protected abstract void Manipulate(IRandom random, IntegerVector integerVector);
    5555  }
    5656}
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Interfaces/IIntegerVectorCreator.cs

    r3054 r3059  
    2828  /// An interface which represents an operator for creating vectors of int-valued data.
    2929  /// </summary>
    30   public interface IIntVectorCreator : IIntVectorOperator, ISolutionCreator {
     30  public interface IIntegerVectorCreator : IIntegerVectorOperator, ISolutionCreator {
    3131    IValueLookupParameter<IntValue> LengthParameter { get; }
    3232    IValueLookupParameter<IntValue> MinimumParameter { get; }
    3333    IValueLookupParameter<IntValue> MaximumParameter { get; }
    34     ILookupParameter<IntArray> IntVectorParameter { get; }
     34    ILookupParameter<IntegerVector> IntegerVectorParameter { get; }
    3535  }
    3636}
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Interfaces/IIntegerVectorCrossover.cs

    r3054 r3059  
    2828  /// An interface which represents an operator for crossing vectors of int-valued data.
    2929  /// </summary>
    30   public interface IIntVectorCrossover : IIntVectorOperator, ICrossover {
    31     ILookupParameter<ItemArray<IntArray>> ParentsParameter { get; }
    32     ILookupParameter<IntArray> ChildParameter { get; }
     30  public interface IIntegerVectorCrossover : IIntegerVectorOperator, ICrossover {
     31    ILookupParameter<ItemArray<IntegerVector>> ParentsParameter { get; }
     32    ILookupParameter<IntegerVector> ChildParameter { get; }
    3333  }
    3434}
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Interfaces/IIntegerVectorManipulator.cs

    r3054 r3059  
    2828  /// An interface which represents an operator for manipulating vectors of int-valued data.
    2929  /// </summary>
    30   public interface IIntVectorManipulator : IIntVectorOperator, IManipulator {
    31     ILookupParameter<IntArray> IntVectorParameter { get; }
     30  public interface IIntegerVectorManipulator : IIntegerVectorOperator, IManipulator {
     31    ILookupParameter<IntegerVector> IntegerVectorParameter { get; }
    3232  }
    3333}
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Interfaces/IIntegerVectorOperator.cs

    r3054 r3059  
    2626  /// An interface which represents an operator dealing with vectors of int-valued data.
    2727  /// </summary>
    28   public interface IIntVectorOperator : IOperator { }
     28  public interface IIntegerVectorOperator : IOperator { }
    2929}
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Manipulators/UniformOnePositionManipulator.cs

    r3053 r3059  
    3232  /// Uniformly distributed change of a single position of an integer vector.
    3333  /// </summary>
    34   /// It is implemented as described in Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg.
    3534  /// <remarks>
    3635  /// It is implemented as described in Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg.
     
    3837  [Item("UniformOnePositionManipulator", " Uniformly distributed change of a single position of an integer vector. It is implemented as described in Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg.")]
    3938  [StorableClass]
    40   public class UniformOnePositionManipulator : IntVectorManipulator {
     39  public class UniformOnePositionManipulator : IntegerVectorManipulator {
    4140    /// <summary>
    4241    /// The lower bound of the values in the int vector.
     
    7069    /// <param name="max">The maximum value of the sampling range for
    7170    /// the vector element to change (exclusive).</param>
    72     public static void Apply(IRandom random, IntArray vector, IntValue min, IntValue max) {
     71    public static void Apply(IRandom random, IntegerVector vector, IntValue min, IntValue max) {
    7372      int index = random.Next(vector.Length);
    7473      vector[index] = random.Next(min.Value, max.Value);
     
    8180    /// <param name="random">A random number generator.</param>
    8281    /// <param name="vector">The integer vector to manipulate.</param>
    83     protected override void Manipulate(IRandom random, IntArray vector) {
     82    protected override void Manipulate(IRandom random, IntegerVector vector) {
    8483      if (MinimumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MinimumParameter.ActualName + " could not be found.");
    8584      if (MaximumParameter.ActualValue == null) throw new InvalidOperationException("UniformOnePositionManipulator: Parameter " + MaximumParameter.ActualName + " could not be found.");
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Tests/DiscreteCrossoverTest.cs

    r3053 r3059  
    6868    public void DiscreteCrossoverCrossTest() {
    6969      DiscreteCrossover_Accessor target = new DiscreteCrossover_Accessor(new PrivateObject(typeof(DiscreteCrossover)));
    70       ItemArray<IntArray> parents;
     70      ItemArray<IntegerVector> parents;
    7171      TestRandom random = new TestRandom();
    7272      bool exceptionFired;
    7373      // The following test checks if there is an exception when there are less than 2 parents
    7474      random.Reset();
    75       parents = new ItemArray<IntArray>(new IntArray[] { new IntArray(4) });
     75      parents = new ItemArray<IntegerVector>(new IntegerVector[] { new IntegerVector(4) });
    7676      exceptionFired = false;
    7777      try {
     
    9090    public void DiscreteCrossoverApplyTest() {
    9191      TestRandom random = new TestRandom();
    92       IntArray parent1, parent2, expected, actual;
     92      IntegerVector parent1, parent2, expected, actual;
    9393      bool exceptionFired;
    9494      // The following test is not based on published examples
    9595      random.Reset();
    9696      random.DoubleNumbers = new double[] { 0, 0, 0.9, 0, 0.9 };
    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 });
     97      parent1 = new IntegerVector(new int[] { 2, 2, 3, 5, 1 });
     98      parent2 = new IntegerVector(new int[] { 4, 1, 3, 2, 8 });
     99      expected = new IntegerVector(new int[] { 2, 2, 3, 5, 8 });
    100100      actual = DiscreteCrossover.Apply(random, parent1, parent2);
    101101      Assert.IsTrue(Auxiliary.IntVectorIsEqualByPosition(actual, expected));
     
    104104      random.Reset();
    105105      random.DoubleNumbers = new double[] { 0, 0, 0.9, 0, 0.9 };
    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 });
     106      parent1 = new IntegerVector(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer
     107      parent2 = new IntegerVector(new int[] { 4, 1, 3, 2, 8 });
    108108      exceptionFired = false;
    109109      try {
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Tests/SinglePointCrossoverTest.cs

    r3053 r3059  
    6868    public void SinglePointCrossoverCrossTest() {
    6969      SinglePointCrossover_Accessor target = new SinglePointCrossover_Accessor(new PrivateObject(typeof(SinglePointCrossover)));
    70       ItemArray<IntArray> parents;
     70      ItemArray<IntegerVector> parents;
    7171      TestRandom random = new TestRandom();
    7272      bool exceptionFired;
    7373      // The following test checks if there is an exception when there are more than 2 parents
    7474      random.Reset();
    75       parents = new ItemArray<IntArray>(new IntArray[] { new IntArray(5), new IntArray(6), new IntArray(4) });
     75      parents = new ItemArray<IntegerVector>(new IntegerVector[] { new IntegerVector(5), new IntegerVector(6), new IntegerVector(4) });
    7676      exceptionFired = false;
    7777      try {
    78         IntArray actual;
     78        IntegerVector actual;
    7979        actual = target.Cross(random, parents);
    8080      }
     
    8585      // The following test checks if there is an exception when there are less than 2 parents
    8686      random.Reset();
    87       parents = new ItemArray<IntArray>(new IntArray[] { new IntArray(4) });
     87      parents = new ItemArray<IntegerVector>(new IntegerVector[] { new IntegerVector(4) });
    8888      exceptionFired = false;
    8989      try {
    90         IntArray actual;
     90        IntegerVector actual;
    9191        actual = target.Cross(random, parents);
    9292      } catch (System.ArgumentException) {
     
    102102    public void SinglePointCrossoverApplyTest() {
    103103      TestRandom random = new TestRandom();
    104       IntArray parent1, parent2, expected, actual;
     104      IntegerVector parent1, parent2, expected, actual;
    105105      bool exceptionFired;
    106106      // The following test is not based on published examples
    107107      random.Reset();
    108108      random.IntNumbers = new int[] { 3 };
    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 });
     109      parent1 = new IntegerVector(new int[] { 2, 2, 3, 5, 1 });
     110      parent2 = new IntegerVector(new int[] { 4, 1, 3, 2, 8 });
     111      expected = new IntegerVector(new int[] { 2, 2, 3, 2, 8 });
    112112      actual = SinglePointCrossover.Apply(random, parent1, parent2);
    113113      Assert.IsTrue(Auxiliary.IntVectorIsEqualByPosition(actual, expected));
     
    115115      random.Reset();
    116116      random.IntNumbers = new int[] { 2 };
    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 });
     117      parent1 = new IntegerVector(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer
     118      parent2 = new IntegerVector(new int[] { 4, 1, 3, 2, 8 });
    119119      exceptionFired = false;
    120120      try {
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Tests/UniformOnePositionManipulatorTest.cs

    r3053 r3059  
    8585    public void UniformOnePositionManipulatorApplyTest() {
    8686      TestRandom random = new TestRandom();
    87       IntArray parent, expected;
     87      IntegerVector parent, expected;
    8888      IntValue min, max;
    8989      // The following test is not based on published examples
    9090      random.Reset();
    9191      random.IntNumbers = new int[] { 3, 3 };
    92       parent = new IntArray(new int[] { 2, 2, 3, 5, 1 });
    93       expected = new IntArray(new int[] { 2, 2, 3, 3, 1 });
     92      parent = new IntegerVector(new int[] { 2, 2, 3, 5, 1 });
     93      expected = new IntegerVector(new int[] { 2, 2, 3, 3, 1 });
    9494      min = new IntValue(2);
    9595      max = new IntValue(7);
Note: See TracChangeset for help on using the changeset viewer.