Changeset 1157
- Timestamp:
- 01/21/09 11:36:53 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.IntVector/DiscreteCrossover.cs
r1057 r1157 26 26 27 27 namespace HeuristicLab.IntVector { 28 /// <summary> 29 /// Discrete crossover for integer vectors. 30 /// </summary> 28 31 public class DiscreteCrossover : IntVectorCrossoverBase { 32 /// <inheritdoc select="summary"/> 29 33 public override string Description { 30 34 get { return "Discrete crossover for integer vectors."; } 31 35 } 32 36 37 /// <summary> 38 /// Performs a discrete crossover operation of the two given parents. 39 /// </summary> 40 /// <param name="random">A random number generator.</param> 41 /// <param name="parent1">The first parent for the crossover operation.</param> 42 /// <param name="parent2">The second parent for the crossover operation.</param> 43 /// <returns>The newly created integer vector, resulting from the crossover operation.</returns> 33 44 public static int[] Apply(IRandom random, int[] parent1, int[] parent2) { 34 45 int length = parent1.Length; … … 44 55 } 45 56 57 /// <summary> 58 /// Performs a discrete crossover operation of the two given parents. 59 /// </summary> 60 /// <param name="scope">The current scope.</param> 61 /// <param name="random">A random number generator.</param> 62 /// <param name="parent1">The first parent for the crossover operation.</param> 63 /// <param name="parent2">The second parent for the crossover operation.</param> 64 /// <returns>The newly created integer vector, resulting from the crossover operation.</returns> 46 65 protected override int[] Cross(IScope scope, IRandom random, int[] parent1, int[] parent2) { 47 66 return Apply(random, parent1, parent2); -
trunk/sources/HeuristicLab.IntVector/HeuristicLabIntVectorPlugin.cs
r1054 r1157 26 26 27 27 namespace HeuristicLab.IntVector { 28 /// <summary> 29 /// Plugin class for HeuristicLab.IntVector plugin. 30 /// </summary> 28 31 [ClassInfo(Name = "HeuristicLab.IntVector-3.2")] 29 32 [PluginFile(Filename = "HeuristicLab.IntVector-3.2.dll", Filetype = PluginFileType.Assembly)] -
trunk/sources/HeuristicLab.IntVector/IntVectorCrossoverBase.cs
r1057 r1157 28 28 29 29 namespace HeuristicLab.IntVector { 30 /// <summary> 31 /// Base class for all integer vector crossover operators. 32 /// </summary> 30 33 public abstract class IntVectorCrossoverBase : CrossoverBase { 34 /// <summary> 35 /// Initializes a new instance of <see cref="IntVectorCrossoverBase"/> with one variable info 36 /// (<c>IntVector</c>). 37 /// </summary> 31 38 public IntVectorCrossoverBase() 32 39 : base() { … … 34 41 } 35 42 43 /// <summary> 44 /// Performs a crossover of two given parents. 45 /// </summary> 46 /// <param name="scope">The current scope.</param> 47 /// <param name="random">A random number generator.</param> 48 /// <param name="parent1">The first parent for crossover.</param> 49 /// <param name="parent2">The second parent for crossover.</param> 50 /// <param name="child">The resulting child scope.</param> 36 51 protected sealed override void Cross(IScope scope, IRandom random, IScope parent1, IScope parent2, IScope child) { 37 52 IVariableInfo intVectorInfo = GetVariableInfo("IntVector"); … … 45 60 } 46 61 62 /// <summary> 63 /// Performs a crossover of two given parents. 64 /// </summary> 65 /// <param name="scope">The current scope.</param> 66 /// <param name="random">A random number generator.</param> 67 /// <param name="parent1">The first parent for crossover.</param> 68 /// <param name="parent2">The second parent for crossover.</param> 69 /// <returns>The newly created integer vector, resulting from the crossover operation.</returns> 47 70 protected abstract int[] Cross(IScope scope, IRandom random, int[] parent1, int[] parent2); 48 71 } -
trunk/sources/HeuristicLab.IntVector/IntVectorManipulatorBase.cs
r1057 r1157 27 27 28 28 namespace HeuristicLab.IntVector { 29 /// <summary> 30 /// Base class for all integer vector manipulators. 31 /// </summary> 29 32 public abstract class IntVectorManipulatorBase : OperatorBase { 33 /// <summary> 34 /// Initializes a new instance of <see cref="IntVectorManipulatorBase"/> with two variable infos 35 /// (<c>Random</c> and <c>IntVector</c>). 36 /// </summary> 30 37 public IntVectorManipulatorBase() { 31 38 AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In)); … … 33 40 } 34 41 42 /// <summary> 43 /// Manipulates the integer vector. 44 /// </summary> 45 /// <param name="scope">The current scope whose integer vector to manipulate.</param> 46 /// <returns><c>null</c>.</returns> 35 47 public override IOperation Apply(IScope scope) { 36 48 IRandom random = GetVariableValue<IRandom>("Random", scope, true); … … 40 52 } 41 53 54 /// <summary> 55 /// Manipulates the given integer <paramref name="vector"/> with the given random number generator. 56 /// </summary> 57 /// <param name="scope">The current scope.</param> 58 /// <param name="random">A random number generator.</param> 59 /// <param name="vector">The integer vector to manipulate.</param> 60 /// <returns>The manipulated integer vector.</returns> 42 61 protected abstract int[] Manipulate(IScope scope, IRandom random, int[] vector); 43 62 } -
trunk/sources/HeuristicLab.IntVector/SinglePointCrossover.cs
r1057 r1157 26 26 27 27 namespace HeuristicLab.IntVector { 28 /// <summary> 29 /// Single point crossover for integer vectors. 30 /// </summary> 28 31 public class SinglePointCrossover : IntVectorCrossoverBase { 32 /// <inheritdoc select="summary"/> 29 33 public override string Description { 30 34 get { return "Single point crossover for integer vectors."; } 31 35 } 32 36 37 /// <summary> 38 /// Performs a single point crossover at a randomly chosen position of the two 39 /// given parent integer 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 integer vector, resulting from the single point crossover.</returns> 33 45 public static int[] Apply(IRandom random, int[] parent1, int[] 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 integer 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 integer vector, resulting from the single point crossover.</returns> 46 67 protected override int[] Cross(IScope scope, IRandom random, int[] parent1, int[] parent2) { 47 68 return Apply(random, parent1, parent2); -
trunk/sources/HeuristicLab.IntVector/UniformAllPositionsManipulator.cs
r1057 r1157 27 27 28 28 namespace HeuristicLab.IntVector { 29 /// <summary> 30 /// Uniformly distributed change of all positions of an integer vector. 31 /// </summary> 29 32 public class UniformAllPositionsManipulator : IntVectorManipulatorBase { 33 /// <inheritdoc select="summary"/> 30 34 public override string Description { 31 35 get { return "Uniformly distributed change of all positions of an integer vector."; } 32 36 } 33 37 38 /// <summary> 39 /// Initializes a new instance of <see cref="UniformAllPositionsManipulator"/> with two variable infos 40 /// (<c>Minimum</c> and <c>Maximum</c>). 41 /// </summary> 34 42 public UniformAllPositionsManipulator() { 35 43 AddVariableInfo(new VariableInfo("Minimum", "Minimum of the sampling range for the vector element (included)", typeof(IntData), VariableKind.In)); … … 37 45 } 38 46 47 /// <summary> 48 /// Changes all position in the given integer <paramref name="vector"/>. 49 /// </summary> 50 /// <param name="random">A random number generator.</param> 51 /// <param name="vector">The integer vector to manipulate.</param> 52 /// <param name="min">The minimum value of the sampling range for each vector element (inclusive).</param> 53 /// <param name="max">The maximum value of the sampling range for each vector element (exclusive).</param> 54 /// <returns>The new integer vector which has been manipulated.</returns> 39 55 public static int[] Apply(IRandom random, int[] vector, int min, int max) { 40 56 int[] result = new int[vector.Length]; … … 44 60 } 45 61 62 /// <summary> 63 /// Changes all position in the given integer <paramref name="vector"/>. 64 /// </summary> 65 /// <remarks>Calls <see cref="Apply"/>.</remarks> 66 /// <param name="scope">The current scope.</param> 67 /// <param name="random">A random number generator.</param> 68 /// <param name="vector">The integer vector to manipulate.</param> 69 /// <returns>The new integer vector which has been manipulated.</returns> 46 70 protected override int[] Manipulate(IScope scope, IRandom random, int[] vector) { 47 71 int min = GetVariableValue<IntData>("Minimum", scope, true).Data; -
trunk/sources/HeuristicLab.IntVector/UniformOnePositionManipulator.cs
r1057 r1157 27 27 28 28 namespace HeuristicLab.IntVector { 29 /// <summary> 30 /// Uniformly distributed change of a single position of an integer vector. 31 /// </summary> 29 32 public class UniformOnePositionManipulator : IntVectorManipulatorBase { 33 /// <inheritdoc select="summary"/> 30 34 public override string Description { 31 35 get { return "Uniformly distributed change of a single position of an integer vector."; } 32 36 } 33 37 38 /// <summary> 39 /// Initializes a new instance of <see cref="UniformOnePositionManipulator"/> with two variable infos 40 /// (<c>Minimum</c> and <c>Maximum</c>). 41 /// </summary> 34 42 public UniformOnePositionManipulator() { 35 43 AddVariableInfo(new VariableInfo("Minimum", "Minimum of the sampling range for the vector element (included)", typeof(IntData), VariableKind.In)); … … 37 45 } 38 46 47 /// <summary> 48 /// Changes randomly a single position in the given integer <paramref name="vector"/>. 49 /// </summary> 50 /// <param name="random">A random number generator.</param> 51 /// <param name="vector">The integer vector to manipulate.</param> 52 /// <param name="min">The minimum value of the sampling range for 53 /// the vector element to change (inclusive).</param> 54 /// <param name="max">The maximum value of the sampling range for 55 /// the vector element to change (exclusive).</param> 56 /// <returns>The new integer vector that has been manipulated.</returns> 39 57 public static int[] Apply(IRandom random, int[] vector, int min, int max) { 40 58 int[] result = (int[])vector.Clone(); … … 44 62 } 45 63 64 /// <summary> 65 /// Changes randomly a single position in the given integer <paramref name="vector"/>. 66 /// </summary> 67 /// <remarks>Calls <see cref="Apply"/>.</remarks> 68 /// <param name="scope">The current scope.</param> 69 /// <param name="random">A random number generator.</param> 70 /// <param name="vector">The integer vector to manipulate.</param> 71 /// <returns>The new integer vector that has been manipulated.</returns> 46 72 protected override int[] Manipulate(IScope scope, IRandom random, int[] vector) { 47 73 int min = GetVariableValue<IntData>("Minimum", scope, true).Data; -
trunk/sources/HeuristicLab.IntVector/UniformRandomIntVectorGenerator.cs
r1057 r1157 27 27 28 28 namespace HeuristicLab.IntVector { 29 /// <summary> 30 /// Generates a new random integer vector with each element uniformly distributed in a specified range. 31 /// </summary> 29 32 public class UniformRandomIntVectorGenerator : OperatorBase { 33 /// <inheritdoc select="summary"/> 30 34 public override string Description { 31 35 get { return "Operator generating a new random integer vector with each element uniformly distributed in a specified range."; } 32 36 } 33 37 38 /// <summary> 39 /// Initializes a new instance of <see cref="UniformRandomIntVectorGenerator"/> with five variable infos 40 /// (<c>Random</c>, <c>Length</c>, <c>Minimum</c>, <c>Maximum</c> and <c>IntVector</c>). 41 /// </summary> 34 42 public UniformRandomIntVectorGenerator() { 35 43 AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In)); … … 40 48 } 41 49 50 /// <summary> 51 /// Generates a new random integer vector with the given <paramref name="length"/>. 52 /// </summary> 53 /// <param name="random">The random number generator.</param> 54 /// <param name="length">The length of the int vector.</param> 55 /// <param name="min">The minimum value of the sampling range for each vector element (inclusive).</param> 56 /// <param name="max">The maximum value of the sampling range for each vector element (exclusive).</param> 57 /// <returns>The newly created integer vector.</returns> 42 58 public static int[] Apply(IRandom random, int length, int min, int max) { 43 59 int[] result = new int[length]; … … 47 63 } 48 64 65 /// <summary> 66 /// Generates a new random integer vector and injects it in the given <paramref name="scope"/>. 67 /// </summary> 68 /// <param name="scope">The scope where to get the values from and where to inject the newly 69 /// created integer vector.</param> 70 /// <returns><c>null</c>.</returns> 49 71 public override IOperation Apply(IScope scope) { 50 72 IRandom random = GetVariableValue<IRandom>("Random", scope, true); -
trunk/sources/HeuristicLab.Random/NormalRandomAdder.cs
r1153 r1157 87 87 /// </summary> 88 88 /// <param name="scope">The scope where to add the generated random number.</param> 89 /// <returns> null.</returns>89 /// <returns><c>null</c>.</returns> 90 90 public override IOperation Apply(IScope scope) { 91 91 IObjectData value = GetVariableValue<IObjectData>("Value", scope, false); -
trunk/sources/HeuristicLab.Random/NormalRandomizer.cs
r1153 r1157 80 80 /// </summary> 81 81 /// <param name="scope">The scope where to assign the new random value to.</param> 82 /// <returns> null.</returns>82 /// <returns><c>null</c>.</returns> 83 83 public override IOperation Apply(IScope scope) { 84 84 IObjectData value = GetVariableValue<IObjectData>("Value", scope, false); -
trunk/sources/HeuristicLab.Random/RandomInjector.cs
r1153 r1157 60 60 /// </summary> 61 61 /// <param name="scope">The scope where to inject the variable.</param> 62 /// <returns> null.</returns>62 /// <returns><c>null</c>.</returns> 63 63 public override IOperation Apply(IScope scope) { 64 64 bool setRandomly = GetVariableValue<BoolData>("SetSeedRandomly", scope, true).Data; -
trunk/sources/HeuristicLab.Random/UniformRandomAdder.cs
r1153 r1157 70 70 /// </summary> 71 71 /// <param name="scope">The current scope where to add the generated random number.</param> 72 /// <returns> null.</returns>72 /// <returns><c>null</c>.</returns> 73 73 public override IOperation Apply(IScope scope) { 74 74 IObjectData value = GetVariableValue<IObjectData>("Value", scope, false); -
trunk/sources/HeuristicLab.Random/UniformRandomizer.cs
r1153 r1157 78 78 /// </summary> 79 79 /// <param name="scope">The scope where to apply the random number generator.</param> 80 /// <returns> null.</returns>80 /// <returns><c>null</c>.</returns> 81 81 public override IOperation Apply(IScope scope) { 82 82 IObjectData value = GetVariableValue<IObjectData>("Value", scope, false); -
trunk/sources/HeuristicLab.Selection.OffspringSelection/OffspringAnalyzer.cs
r1153 r1157 64 64 /// smaller than 1.</exception> 65 65 /// <param name="scope">The scope whose offspring should be analyzed.</param> 66 /// <returns>The next operation or null.</returns>66 /// <returns>The next operation or <c>null</c>.</returns> 67 67 public override IOperation Apply(IScope scope) { 68 68 bool maximize = GetVariableValue<BoolData>("Maximization", scope, true).Data; -
trunk/sources/HeuristicLab.Selection.OffspringSelection/OffspringSelector.cs
r1153 r1157 56 56 /// </summary> 57 57 /// <param name="scope">The current scope of the parents and the children.</param> 58 /// <returns>The next operation or null.</returns>58 /// <returns>The next operation or <c>null</c>.</returns> 59 59 public override IOperation Apply(IScope scope) { 60 60 double selectionPressureLimit = GetVariableValue<DoubleData>("SelectionPressureLimit", scope, true).Data;
Note: See TracChangeset
for help on using the changeset viewer.