- Timestamp:
- 01/28/09 10:20:40 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.RealVector/UniformOnePositionManipulator.cs
r2 r1184 27 27 28 28 namespace HeuristicLab.RealVector { 29 /// <summary> 30 /// Uniformly distributed change of a single position of a real vector. 31 /// </summary> 29 32 public class UniformOnePositionManipulator : RealVectorManipulatorBase { 33 /// <inheritdoc select="summary"/> 30 34 public override string Description { 31 35 get { return "Uniformly distributed change of a single position of a real 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(DoubleData), VariableKind.In)); … … 37 45 } 38 46 47 /// <summary> 48 /// Changes randomly a single position in the given real <paramref name="vector"/>. 49 /// </summary> 50 /// <param name="random">A random number generator.</param> 51 /// <param name="vector">The real 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 real vector that has been manipulated.</returns> 39 57 public static double[] Apply(IRandom random, double[] vector, double min, double max) { 40 58 double[] result = (double[])vector.Clone(); … … 44 62 } 45 63 64 /// <summary> 65 /// Changes randomly a single position in the given real <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 real vector to manipulate.</param> 71 /// <returns>The new real vector that has been manipulated.</returns> 46 72 protected override double[] Manipulate(IScope scope, IRandom random, double[] vector) { 47 73 double min = GetVariableValue<DoubleData>("Minimum", scope, true).Data;
Note: See TracChangeset
for help on using the changeset viewer.