Changeset 1157


Ignore:
Timestamp:
01/21/09 11:36:53 (12 years ago)
Author:
vdorfer
Message:

Created API documentation for HeuristicLab.IntVector namespace and changed some comments in HeuristicLab.Random and HeuristicLab.Selection.Offspring namespace(#331)

Location:
trunk/sources
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.IntVector/DiscreteCrossover.cs

    r1057 r1157  
    2626
    2727namespace HeuristicLab.IntVector {
     28  /// <summary>
     29  /// Discrete crossover for integer vectors.
     30  /// </summary>
    2831  public class DiscreteCrossover : IntVectorCrossoverBase {
     32    /// <inheritdoc select="summary"/>
    2933    public override string Description {
    3034      get { return "Discrete crossover for integer vectors."; }
    3135    }
    3236
     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>
    3344    public static int[] Apply(IRandom random, int[] parent1, int[] parent2) {
    3445      int length = parent1.Length;
     
    4455    }
    4556
     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>
    4665    protected override int[] Cross(IScope scope, IRandom random, int[] parent1, int[] parent2) {
    4766      return Apply(random, parent1, parent2);
  • trunk/sources/HeuristicLab.IntVector/HeuristicLabIntVectorPlugin.cs

    r1054 r1157  
    2626
    2727namespace HeuristicLab.IntVector {
     28  /// <summary>
     29  /// Plugin class for HeuristicLab.IntVector plugin.
     30  /// </summary>
    2831  [ClassInfo(Name = "HeuristicLab.IntVector-3.2")]
    2932  [PluginFile(Filename = "HeuristicLab.IntVector-3.2.dll", Filetype = PluginFileType.Assembly)]
  • trunk/sources/HeuristicLab.IntVector/IntVectorCrossoverBase.cs

    r1057 r1157  
    2828
    2929namespace HeuristicLab.IntVector {
     30  /// <summary>
     31  /// Base class for all integer vector crossover operators.
     32  /// </summary>
    3033  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>
    3138    public IntVectorCrossoverBase()
    3239      : base() {
     
    3441    }
    3542
     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>
    3651    protected sealed override void Cross(IScope scope, IRandom random, IScope parent1, IScope parent2, IScope child) {
    3752      IVariableInfo intVectorInfo = GetVariableInfo("IntVector");
     
    4560    }
    4661
     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>
    4770    protected abstract int[] Cross(IScope scope, IRandom random, int[] parent1, int[] parent2);
    4871  }
  • trunk/sources/HeuristicLab.IntVector/IntVectorManipulatorBase.cs

    r1057 r1157  
    2727
    2828namespace HeuristicLab.IntVector {
     29  /// <summary>
     30  /// Base class for all integer vector manipulators.
     31  /// </summary>
    2932  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>
    3037    public IntVectorManipulatorBase() {
    3138      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
     
    3340    }
    3441
     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>
    3547    public override IOperation Apply(IScope scope) {
    3648      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
     
    4052    }
    4153
     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>
    4261    protected abstract int[] Manipulate(IScope scope, IRandom random, int[] vector);
    4362  }
  • trunk/sources/HeuristicLab.IntVector/SinglePointCrossover.cs

    r1057 r1157  
    2626
    2727namespace HeuristicLab.IntVector {
     28  /// <summary>
     29  /// Single point crossover for integer vectors.
     30  /// </summary>
    2831  public class SinglePointCrossover : IntVectorCrossoverBase {
     32    /// <inheritdoc select="summary"/>
    2933    public override string Description {
    3034      get { return "Single point crossover for integer vectors."; }
    3135    }
    3236
     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>
    3345    public static int[] Apply(IRandom random, int[] parent1, int[] parent2) {
    3446      int length = parent1.Length;
     
    4456    }
    4557
     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>
    4667    protected override int[] Cross(IScope scope, IRandom random, int[] parent1, int[] parent2) {
    4768      return Apply(random, parent1, parent2);
  • trunk/sources/HeuristicLab.IntVector/UniformAllPositionsManipulator.cs

    r1057 r1157  
    2727
    2828namespace HeuristicLab.IntVector {
     29  /// <summary>
     30  /// Uniformly distributed change of all positions of an integer vector.
     31  /// </summary>
    2932  public class UniformAllPositionsManipulator : IntVectorManipulatorBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return "Uniformly distributed change of all positions of an integer vector."; }
    3236    }
    3337
     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>
    3442    public UniformAllPositionsManipulator() {
    3543      AddVariableInfo(new VariableInfo("Minimum", "Minimum of the sampling range for the vector element (included)", typeof(IntData), VariableKind.In));
     
    3745    }
    3846
     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>
    3955    public static int[] Apply(IRandom random, int[] vector, int min, int max) {
    4056      int[] result = new int[vector.Length];
     
    4460    }
    4561
     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>
    4670    protected override int[] Manipulate(IScope scope, IRandom random, int[] vector) {
    4771      int min = GetVariableValue<IntData>("Minimum", scope, true).Data;
  • trunk/sources/HeuristicLab.IntVector/UniformOnePositionManipulator.cs

    r1057 r1157  
    2727
    2828namespace HeuristicLab.IntVector {
     29  /// <summary>
     30  /// Uniformly distributed change of a single position of an integer vector.
     31  /// </summary>
    2932  public class UniformOnePositionManipulator : IntVectorManipulatorBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return "Uniformly distributed change of a single position of an integer vector."; }
    3236    }
    3337
     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>
    3442    public UniformOnePositionManipulator() {
    3543      AddVariableInfo(new VariableInfo("Minimum", "Minimum of the sampling range for the vector element (included)", typeof(IntData), VariableKind.In));
     
    3745    }
    3846
     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>
    3957    public static int[] Apply(IRandom random, int[] vector, int min, int max) {
    4058      int[] result = (int[])vector.Clone();
     
    4462    }
    4563
     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>
    4672    protected override int[] Manipulate(IScope scope, IRandom random, int[] vector) {
    4773      int min = GetVariableValue<IntData>("Minimum", scope, true).Data;
  • trunk/sources/HeuristicLab.IntVector/UniformRandomIntVectorGenerator.cs

    r1057 r1157  
    2727
    2828namespace HeuristicLab.IntVector {
     29  /// <summary>
     30  /// Generates a new random integer vector with each element uniformly distributed in a specified range.
     31  /// </summary>
    2932  public class UniformRandomIntVectorGenerator : OperatorBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return "Operator generating a new random integer vector with each element uniformly distributed in a specified range."; }
    3236    }
    3337
     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>
    3442    public UniformRandomIntVectorGenerator() {
    3543      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
     
    4048    }
    4149
     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>
    4258    public static int[] Apply(IRandom random, int length, int min, int max) {
    4359      int[] result = new int[length];
     
    4763    }
    4864
     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>
    4971    public override IOperation Apply(IScope scope) {
    5072      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
  • trunk/sources/HeuristicLab.Random/NormalRandomAdder.cs

    r1153 r1157  
    8787    /// </summary>
    8888    /// <param name="scope">The scope where to add the generated random number.</param>
    89     /// <returns>null.</returns>
     89    /// <returns><c>null</c>.</returns>
    9090    public override IOperation Apply(IScope scope) {
    9191      IObjectData value = GetVariableValue<IObjectData>("Value", scope, false);
  • trunk/sources/HeuristicLab.Random/NormalRandomizer.cs

    r1153 r1157  
    8080    /// </summary>
    8181    /// <param name="scope">The scope where to assign the new random value to.</param>
    82     /// <returns>null.</returns>
     82    /// <returns><c>null</c>.</returns>
    8383    public override IOperation Apply(IScope scope) {
    8484      IObjectData value = GetVariableValue<IObjectData>("Value", scope, false);
  • trunk/sources/HeuristicLab.Random/RandomInjector.cs

    r1153 r1157  
    6060    /// </summary>
    6161    /// <param name="scope">The scope where to inject the variable.</param>
    62     /// <returns>null.</returns>
     62    /// <returns><c>null</c>.</returns>
    6363    public override IOperation Apply(IScope scope) {
    6464      bool setRandomly = GetVariableValue<BoolData>("SetSeedRandomly", scope, true).Data;
  • trunk/sources/HeuristicLab.Random/UniformRandomAdder.cs

    r1153 r1157  
    7070    /// </summary>
    7171    /// <param name="scope">The current scope where to add the generated random number.</param>
    72     /// <returns>null.</returns>
     72    /// <returns><c>null</c>.</returns>
    7373    public override IOperation Apply(IScope scope) {
    7474      IObjectData value = GetVariableValue<IObjectData>("Value", scope, false);
  • trunk/sources/HeuristicLab.Random/UniformRandomizer.cs

    r1153 r1157  
    7878    /// </summary>
    7979    /// <param name="scope">The scope where to apply the random number generator.</param>
    80     /// <returns>null.</returns>
     80    /// <returns><c>null</c>.</returns>
    8181    public override IOperation Apply(IScope scope) {
    8282      IObjectData value = GetVariableValue<IObjectData>("Value", scope, false);
  • trunk/sources/HeuristicLab.Selection.OffspringSelection/OffspringAnalyzer.cs

    r1153 r1157  
    6464    /// smaller than 1.</exception>
    6565    /// <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>
    6767    public override IOperation Apply(IScope scope) {
    6868      bool maximize = GetVariableValue<BoolData>("Maximization", scope, true).Data;
  • trunk/sources/HeuristicLab.Selection.OffspringSelection/OffspringSelector.cs

    r1153 r1157  
    5656    /// </summary>
    5757    /// <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>
    5959    public override IOperation Apply(IScope scope) {
    6060      double selectionPressureLimit = GetVariableValue<DoubleData>("SelectionPressureLimit", scope, true).Data;
Note: See TracChangeset for help on using the changeset viewer.