Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2964 for trunk


Ignore:
Timestamp:
03/08/10 11:37:24 (15 years ago)
Author:
abeham
Message:

Updated real vector operators #890:
Added AverageCrossover, UniformAllPositionsArithmeticCrossover, and UniformSomePositionsArithmeticCrossover
Removed ContinuousCrossover, CompleteContinuousCrossover, and UniformAllPositionsManipulator
Updated the description and documentation in HeuristicCrossover, LocalCrossover, and RandomConvexCrossover

Location:
trunk/sources/HeuristicLab.Encodings.RealVector/3.3
Files:
3 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/HeuristicCrossover.cs

    r2936 r2964  
    3030namespace HeuristicLab.Encodings.RealVector {
    3131  /// <summary>
    32   /// Heuristic crossover for real vectors: Takes for each position the better parent and adds the difference
    33   /// of the two parents times a randomly chosen factor.
     32  /// Heuristic crossover for real vectors: Calculates the vector from the worse to the better parent and adds that to the better parent weighted with a factor in the interval [0;1).
     33  /// The idea is that going further in direction from the worse to the better leads to even better solutions (naturally this depends on the fitness landscape).
    3434  /// </summary>
    3535  /// <remarks>
    3636  /// It is implemented as described in Wright, A.H. (1994), Genetic algorithms for real parameter optimization, Foundations of Genetic Algorithms, G.J.E. Rawlins (Ed.), Morgan Kaufmann, San Mateo, CA, 205-218.
    3737  /// </remarks>
    38   [Item("HeuristicCrossover", "Heuristic crossover for real vectors: Takes for each position the better parent and adds the difference. It is implemented as described in Wright, A.H. (1994), Genetic algorithms for real parameter optimization, Foundations of Genetic Algorithms, G.J.E. Rawlins (Ed.), Morgan Kaufmann, San Mateo, CA, 205-218.")]
     38  [Item("HeuristicCrossover", "The heuristic crossover produces offspring that extend the better parent in direction from the worse to the better parent. It is implemented as described in Wright, A.H. (1994), Genetic algorithms for real parameter optimization, Foundations of Genetic Algorithms, G.J.E. Rawlins (Ed.), Morgan Kaufmann, San Mateo, CA, 205-218.")]
    3939  [EmptyStorableClass]
    4040  public class HeuristicCrossover : RealVectorCrossover {
     
    7272    public static DoubleArrayData Apply(IRandom random, DoubleArrayData betterParent, DoubleArrayData worseParent) {
    7373      if (betterParent.Length != worseParent.Length)
    74         throw new ArgumentException("ERROR in HeuristicCrossover: the two parents are not of the same length");
     74        throw new ArgumentException("HeuristicCrossover: the two parents are not of the same length");
    7575     
    7676      int length = betterParent.Length;
     
    9999    /// <returns>The newly created real vector, resulting from the crossover operation.</returns>
    100100    protected override DoubleArrayData Cross(IRandom random, ItemArray<DoubleArrayData> parents) {
    101       if (parents.Length != 2) throw new ArgumentException("ERROR in HeuristicCrossover: The number of parents is not equal to 2");
     101      if (parents.Length != 2) throw new ArgumentException("HeuristicCrossover: The number of parents is not equal to 2");
    102102
    103103      if (MaximizationParameter.ActualValue == null) throw new InvalidOperationException("HeuristicCrossover: Parameter " + MaximizationParameter.ActualName + " could not be found.");
  • trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/LocalCrossover.cs

    r2936 r2964  
    2929namespace HeuristicLab.Encodings.RealVector {
    3030  /// <summary>
    31   /// Local crossover for real vectors: Takes for each element the allele of the first parent times a
    32   /// always newly created randomly chosen factor and adds the allele of the second parent times (1 - the randomly chosen factor).
     31  /// The local crossover for real vectors is similar to the <see cref="UniformAllPositionsArithmeticCrossover"/>, but where the factor alpha is chosen randomly in the interval [0;1) for each position.
    3332  /// </summary>
    3433  /// <remarks>
    3534  /// It is implemented as described in Dumitrescu, D. et al. (2000), Evolutionary computation, CRC Press, Boca Raton, FL, p. 194.
    3635  /// </remarks>
    37   [Item("LocalCrossover", "Local crossover for real vectors: Takes for each element the allele of the first parent times a always newly created randomly chosen factor and adds the allele of the second parent times (1 - the randomly chosen factor. " +
    38     "It is implemented as described in Dumitrescu, D. et al. (2000), Evolutionary computation, CRC Press, Boca Raton, FL., p. 194.")]
     36  [Item("LocalCrossover", @"The local crossover is similar to the arithmetic all positions crossover, but uses a random alpha for each position x = alpha * p1 + (1-alpha) * p2. It is implemented as described in Dumitrescu, D. et al. (2000), Evolutionary computation, CRC Press, Boca Raton, FL., p. 194.")]
    3937  [EmptyStorableClass]
    4038  public class LocalCrossover : RealVectorCrossover {
     
    4947    public static DoubleArrayData Apply(IRandom random, DoubleArrayData parent1, DoubleArrayData parent2) {
    5048      if (parent1.Length != parent2.Length)
    51         throw new ArgumentException("ERROR in LocalCrossover: the two parents are not of the same length");
     49        throw new ArgumentException("LocalCrossover: the two parents are not of the same length");
    5250     
    5351      double factor;
     
    7068    /// <returns>The newly created real vector, resulting from the crossover operation.</returns>
    7169    protected override DoubleArrayData Cross(IRandom random, ItemArray<DoubleArrayData> parents) {
    72       if (parents.Length != 2) throw new ArgumentException("ERROR in LocalCrossover: The number of parents is not equal to 2");
     70      if (parents.Length != 2) throw new ArgumentException("LocalCrossover: The number of parents is not equal to 2");
    7371      return Apply(random, parents[0], parents[1]);
    7472    }
  • trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Crossovers/RandomConvexCrossover.cs

    r2936 r2964  
    2929namespace HeuristicLab.Encodings.RealVector {
    3030  /// <summary>
    31   /// Random convex crossover for real vectors: Takes for each element the allele of the first parent times a
    32   /// once created randomly chosen factor and adds the allele of the second parent times
    33   /// (1 - the randomly chosen factor).
     31  /// The random convex crossover is similar to the <see cref="LocalCrossover"/>, but chooses just one random alpha for all positions.
    3432  /// </summary>
    3533  /// <remarks>
    3634  /// It is implemented as described in Dumitrescu, D. et al. (2000), Evolutionary computation, CRC Press, Boca Raton, FL, pp. 193 - 194.
    3735  /// </remarks>
    38   [Item("RandomConvexCrossover", "Random convex crossover for real vectors: Takes for each element the allele of the first parent times a once created randomly chosen factor and adds the allele of the second parent times (1 - the randomly chosen factor). " +
    39     "It is implementes as described in Dumitrescu, D. et al. (2000), Evolutionary computation, CRC Press, Boca Raton, FL, pp. 193 - 194.")]
     36  [Item("RandomConvexCrossover", "The random convex crossover acts like the local crossover, but with just one randomly chosen alpha for all crossed positions. It is implementes as described in Dumitrescu, D. et al. (2000), Evolutionary computation, CRC Press, Boca Raton, FL, pp. 193 - 194.")]
    4037  [EmptyStorableClass]
    4138  public class RandomConvexCrossover : RealVectorCrossover {
  • trunk/sources/HeuristicLab.Encodings.RealVector/3.3/HeuristicLab.Encodings.RealVector-3.3.csproj

    r2936 r2964  
    9191  </ItemGroup>
    9292  <ItemGroup>
     93    <Compile Include="Crossovers\AverageCrossover.cs" />
    9394    <Compile Include="Crossovers\BlendAlphaCrossover.cs" />
    9495    <Compile Include="Crossovers\DiscreteCrossover.cs" />
     
    100101      <SubType>Code</SubType>
    101102    </Compile>
     103    <Compile Include="Crossovers\UniformAllPositionsArithmeticCrossover.cs" />
     104    <Compile Include="Crossovers\UniformSomePositionsArithmeticCrossover.cs" />
    102105    <Compile Include="HeuristicLabEncodingsRealVectorPlugin.cs" />
    103106    <Compile Include="Manipulators\PolynomialAllPositionManipulator.cs" />
Note: See TracChangeset for help on using the changeset viewer.