- Timestamp:
- 01/27/09 09:31:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.BitVector/SinglePointCrossover.cs
r2 r1176 26 26 27 27 namespace HeuristicLab.BitVector { 28 /// <summary> 29 /// Single point crossover for bit vectors. 30 /// </summary> 28 31 public class SinglePointCrossover : BitVectorCrossoverBase { 32 /// <inheritdoc select="summary"/> 29 33 public override string Description { 30 34 get { return "Single point crossover for bit vectors."; } 31 35 } 32 36 37 /// <summary> 38 /// Performs a single point crossover at a randomly chosen position of the two 39 /// given parent bit vectors. 40 /// </summary> 41 /// <param name="random">A random number generator.</param> 42 /// <param name="parent1">The first parent for crossover.</param> 43 /// <param name="parent2">The second parent for crossover.</param> 44 /// <returns>The newly created bit vector, resulting from the single point crossover.</returns> 33 45 public static bool[] Apply(IRandom random, bool[] parent1, bool[] parent2) { 34 46 int length = parent1.Length; … … 44 56 } 45 57 58 /// <summary> 59 /// Performs a single point crossover at a randomly chosen position of the two 60 /// given parent bit vectors. 61 /// </summary> 62 /// <param name="scope">The current scope.</param> 63 /// <param name="random">A random number generator.</param> 64 /// <param name="parent1">The first parent for crossover.</param> 65 /// <param name="parent2">The second parent for crossover.</param> 66 /// <returns>The newly created bit vector, resulting from the single point crossover.</returns> 46 67 protected override bool[] Cross(IScope scope, IRandom random, bool[] parent1, bool[] parent2) { 47 68 return Apply(random, parent1, parent2);
Note: See TracChangeset
for help on using the changeset viewer.