Free cookie consent management tool by TermsFeed Policy Generator

Changeset 817


Ignore:
Timestamp:
11/26/08 10:29:34 (15 years ago)
Author:
vdorfer
Message:

Created API documentation for HeuristicLab.Selection namespace (#331)

Location:
trunk/sources
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/Interfaces/IRandom.cs

    r776 r817  
    4848    /// Gets a new random number between 0 and <paramref name="maxVal"/>.
    4949    /// </summary>
    50     /// <param name="maxVal">The maximal value of the random number.</param>
    51     /// <returns>A random integer number smaller than or equal to <paramref name="maxVal"/>.</returns>
     50    /// <param name="maxVal">The maximal value of the random number (exclusive).</param>
     51    /// <returns>A random integer number smaller than <paramref name="maxVal"/>.</returns>
    5252    int Next(int maxVal);
    5353    /// <summary>
    5454    /// Gets a new random number between <paramref name="minVal"/> and <paramref name="maxVal"/>.
    5555    /// </summary>
    56     /// <param name="maxVal">The maximal value of the random number.</param>
    57     /// <param name="minVal">The minimal value of the random number.</param>
    58     /// <returns>A random integer number. (<paramref name="minVal"/> &lt;= x &lt;= <paramref name="maxVal"/>.</returns>
     56    /// <param name="maxVal">The maximal value of the random number (exclusive).</param>
     57    /// <param name="minVal">The minimal value of the random number (inclusive).</param>
     58    /// <returns>A random integer number. (<paramref name="minVal"/> &lt;= x &lt; <paramref name="maxVal"/>).</returns>
    5959    int Next(int minVal, int maxVal);
    6060    /// <summary>
  • trunk/sources/HeuristicLab.Selection/HeuristicLabSelectionPlugin.cs

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

    r2 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Takes only sub scopes from the left child of the tree.
     31  /// </summary>
    2932  public class LeftReducer : ReducerBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return @"TODO\r\nOperator description still missing ..."; }
    3236    }
    3337
     38    /// <summary>
     39    /// Takes only the sub scopes from the left sub scope of the tree.
     40    /// </summary>
     41    /// <param name="scope">The current scope.</param>
     42    /// <returns>All sub scopes from the left part of the tree.</returns>
    3443    protected override ICollection<IScope> Reduce(IScope scope) {
    3544      List<IScope> subScopes = new List<IScope>();
  • trunk/sources/HeuristicLab.Selection/LeftSelector.cs

    r2 r817  
    2626
    2727namespace HeuristicLab.Selection {
     28  /// <summary>
     29  /// Copies or moves a defined number of sub scopes from a source scope to a target scope, starting at
     30  /// the left side of the tree.
     31  /// </summary>
    2832  public class LeftSelector : StochasticSelectorBase {
     33    /// <inheritdoc select="summary"/>
    2934    public override string Description {
    3035      get { return @"TODO\r\nOperator description still missing ..."; }
    3136    }
    3237
     38    /// <summary>
     39    /// Copies or moves a number of sub scopes (<paramref name="selected"/>) from <paramref name="source"/>
     40    /// starting at the left end to the <paramref name="target"/>.
     41    /// </summary>
     42    /// <param name="random">A random number generator.</param>
     43    /// <param name="source">The source scope from which to copy/move the sub scopes.</param>
     44    /// <param name="selected">The number of sub scopes to move. Can be also bigger than the total
     45    /// number of sub scopes in <paramref name="source"/>, then the copying process starts again from the
     46    /// beginning.</param>
     47    /// <param name="target">The target where to copy/move the sub scopes.</param>
     48    /// <param name="copySelected">Boolean flag whether the sub scopes shall be copied or moved.</param>
    3349    protected override void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected) {
    3450      int index = 0;
  • trunk/sources/HeuristicLab.Selection/LinearRankSelector.cs

    r2 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Selects scopes based on their rank, which has been determined through their quality.
     31  /// </summary>
    2932  public class LinearRankSelector : StochasticSelectorBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return @"TODO\r\nOperator description still missing ..."; }
    3236    }
    3337
     38    /// <summary>
     39    /// Initializes a new instance of <see cref="LinearRankSelector"/> with the <c>CopySelected</c> flag
     40    /// set to <c>true</c>.
     41    /// </summary>
    3442    public LinearRankSelector() {
    3543      GetVariable("CopySelected").GetValue<BoolData>().Data = true;
    3644    }
    3745
     46    /// <summary>
     47    /// Copies or moves sub scopes from the given <paramref name="source"/> to the specified
     48    /// <paramref name="target"/> according to their rank which is determined through their quality.
     49    /// </summary>
     50    /// <exception cref="InvalidOperationException">Thrown when no source sub scopes are available.</exception>
     51    /// <param name="random">The random number generator.</param>
     52    /// <param name="source">The source scope from where to copy/move the sub scopes.</param>
     53    /// <param name="selected">The number of sub scopes to copy/move.</param>
     54    /// <param name="target">The target scope where to add the sub scopes.</param>
     55    /// <param name="copySelected">Boolean flag whether the sub scopes shall be moved or copied.</param>
    3856    protected override void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected) {
    3957      int subScopes = source.SubScopes.Count;
  • trunk/sources/HeuristicLab.Selection/MergingReducer.cs

    r2 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Merges all sub scopes of the children to one list.
     31  /// </summary>
    2932  public class MergingReducer : ReducerBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return @"TODO\r\nOperator description still missing ..."; }
    3236    }
    3337
     38    /// <summary>
     39    /// Merges all sub scopes of the sub scopes of the current <paramref name="scope"/>.
     40    /// </summary>
     41    /// <param name="scope">The current scope whose sub scopes to merge.</param>
     42    /// <returns>A list of all merged subscopes of the given <paramref name="scope"/>.</returns>
    3443    protected override ICollection<IScope> Reduce(IScope scope) {
    3544      List<IScope> subScopes = new List<IScope>();
  • trunk/sources/HeuristicLab.Selection/ProportionalSelector.cs

    r772 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Copies or moves a number of sub scopes from a source scope to a target scope, their probability
     31  /// to be selected depending on their quality.
     32  /// </summary>
    2933  public class ProportionalSelector : StochasticSelectorBase {
     34    /// <inheritdoc select="summary"/>
    3035    public override string Description {
    3136      get { return @"TODO\r\nOperator description still missing ..."; }
    3237    }
    3338
     39    /// <summary>
     40    /// Initializes a new instance of <see cref="ProportionalSelector"/> with three variable infos
     41    /// (<c>Maximization</c>, <c>Quality</c> and <c>Windowing</c>, being a local variable and initialized
     42    /// with <c>true</c>) and the <c>CopySelected</c> flag set to <c>true</c>.
     43    /// </summary>
    3444    public ProportionalSelector() {
    3545      AddVariableInfo(new VariableInfo("Maximization", "Maximization problem", typeof(BoolData), VariableKind.In));
     
    4151    }
    4252
     53    /// <summary>
     54    /// Copies or movies a number of sub scopes (<paramref name="selected"/>) in the given
     55    /// <paramref name="source"/> to the given <paramref name="target"/>, selection takes place with respect
     56    /// to the quality of the scope.
     57    /// </summary>
     58    /// <param name="random">The random number generator.</param>
     59    /// <param name="source">The source scope from where to copy/move the sub scopes.</param>
     60    /// <param name="selected">The number of sub scopes to copy/move.</param>
     61    /// <param name="target">The target scope where to add the sub scopes.</param>
     62    /// <param name="copySelected">Boolean flag whether the sub scopes shall be moved or copied.</param>
    4363    protected override void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected) {
    4464      bool maximization = GetVariableValue<BoolData>("Maximization", source, true).Data;
     
    7494    }
    7595
     96    /// <summary>
     97    /// Calculates the qualities of the sub scopes of the given <paramref name="source"/>.
     98    /// </summary>
     99    /// <exception cref="InvalidOperationException">Thrown when the sub scopes are not sorted according
     100    /// to their solution qualities or if the quality value is beyond zero and the <c>windowing</c>
     101    /// flag is set to <c>false</c>.</exception>
     102    /// <param name="source">The scource scope where to calculate the qualities.</param>
     103    /// <param name="maximization">Boolean flag whether is a maximization problem.</param>
     104    /// <param name="qualityInfo">The quality variable info.</param>
     105    /// <param name="windowing">Boolean flag whether the windowing strategy shall be applied.</param>
     106    /// <param name="qualities">Output parameter; contains all qualities of the sub scopes.</param>
     107    /// <param name="qualitySum">Output parameter; the sum of all qualities.</param>
    76108    private void GenerateQualitiesArray(IScope source, bool maximization, IVariableInfo qualityInfo, bool windowing, out double[] qualities, out double qualitySum) {
    77109      int subScopes = source.SubScopes.Count;
  • trunk/sources/HeuristicLab.Selection/RandomSelector.cs

    r2 r817  
    2626
    2727namespace HeuristicLab.Selection {
     28  /// <summary>
     29  /// Copies or moves a defined number of sub scopes from a source scope to a target scope, being selected
     30  /// randomly.
     31  /// </summary>
    2832  public class RandomSelector : StochasticSelectorBase {
     33    /// <inheritdoc select="summary"/>
    2934    public override string Description {
    3035      get { return @"TODO\r\nOperator description still missing ..."; }
    3136    }
    3237
     38    /// <summary>
     39    /// Copies or moves a number of sub scopes (<paramref name="selected"/>) from <paramref name="source"/>
     40    /// to the <paramref name="target"/>, chosen randomly.
     41    /// </summary>
     42    /// <param name="random">The random number generator.</param>
     43    /// <param name="source">The source scope from which to copy/move the sub scopes.</param>
     44    /// <param name="selected">The number of sub scopes to move.</param>
     45    /// <param name="target">The target where to copy/move the sub scopes.</param>
     46    /// <param name="copySelected">Boolean flag whether the sub scopes shall be copied or moved.</param>
    3347    protected override void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected) {
    3448      for (int i = 0; i < selected; i++) {
  • trunk/sources/HeuristicLab.Selection/ReducerBase.cs

    r2 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Base class for all reducers.
     31  /// </summary>
    2932  public abstract class ReducerBase : OperatorBase {
     33    /// <summary>
     34    /// Reduces the given <paramref name="scope"/> so that it contains in the end only the reduced
     35    /// elements.
     36    /// </summary>
     37    /// <remarks>Calls <see cref="Reduce"/>.</remarks>
     38    /// <param name="scope">The scope to reduce.</param>
     39    /// <returns><c>null</c>.</returns>
    3040    public override IOperation Apply(IScope scope) {
    3141      ICollection<IScope> subScopes = Reduce(scope);
     
    4050    }
    4151
     52    /// <summary>
     53    /// Reduces the current <paramref name="scope"/>.
     54    /// </summary>
     55    /// <param name="scope">The scope to reduce.</param>
     56    /// <returns>The reduced list of scopes, that should be kept.</returns>
    4257    protected abstract ICollection<IScope> Reduce(IScope scope);
    4358  }
  • trunk/sources/HeuristicLab.Selection/RightChildReducer.cs

    r2 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Reduces the sub scopes by one level, so that the right sub scope contains also the right child scopes
     31  /// of the left sub scope and the left sub scope represents its left child scope.
     32  /// </summary>
    2933  public class RightChildReducer : ReducerBase {
     34    /// <inheritdoc select="summary"/>
    3035    public override string Description {
    3136      get { return @"TODO\r\nOperator description still missing ..."; }
    3237    }
    3338
     39    /// <summary>
     40    /// Reduces the right child of the left sub scope and adds its sub scopes to the right sub scope.
     41    /// The left sub scope is also narrowed, which means it represents then its left child.
     42    /// </summary>
     43    /// <param name="scope">The current scope to reduce.</param>
     44    /// <returns>A list of the new reduced sub scopes.</returns>
    3445    protected override ICollection<IScope> Reduce(IScope scope) {
    3546      IScope rightChild = scope.SubScopes[scope.SubScopes.Count - 1];
  • trunk/sources/HeuristicLab.Selection/RightReducer.cs

    r2 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Takes only sub scopes from the right child of the tree.
     31  /// </summary>
    2932  public class RightReducer : ReducerBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return @"TODO\r\nOperator description still missing ..."; }
    3236    }
    3337
     38    /// <summary>
     39    /// Takes only the sub scopes from the right part of the tree.
     40    /// </summary>
     41    /// <param name="scope">The current scope.</param>
     42    /// <returns>All sub scopes from the right sub scope of the tree.</returns>
    3443    protected override ICollection<IScope> Reduce(IScope scope) {
    3544      List<IScope> subScopes = new List<IScope>();
  • trunk/sources/HeuristicLab.Selection/RightSelector.cs

    r2 r817  
    2626
    2727namespace HeuristicLab.Selection {
     28  /// <summary>
     29  /// Copies or moves a defined number of sub scopes from a source scope to a target scope, starting at
     30  /// the right side of the tree.
     31  /// </summary>
    2832  public class RightSelector : StochasticSelectorBase {
     33    /// <inheritdoc select="summary"/>
    2934    public override string Description {
    3035      get { return @"TODO\r\nOperator description still missing ..."; }
    3136    }
    3237
     38    /// <summary>
     39    /// Copies or moves a number of sub scopes (<paramref name="selected"/>) from <paramref name="source"/>
     40    /// starting at the right end to the <paramref name="target"/>.
     41    /// </summary>
     42    /// <param name="random">A random number generator.</param>
     43    /// <param name="source">The source scope from which to copy/move the sub scopes.</param>
     44    /// <param name="selected">The number of sub scopes to move. Can be also bigger than the total
     45    /// number of sub scopes in <paramref name="source"/>, then the copying process starts again from the
     46    /// beginning.</param>
     47    /// <param name="target">The target where to copy/move the sub scopes.</param>
     48    /// <param name="copySelected">Boolean flag whether the sub scopes shall be copied or moved.</param>
    3349    protected override void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected) {
    3450      int index = source.SubScopes.Count - 1;
  • trunk/sources/HeuristicLab.Selection/SelectorBase.cs

    r2 r817  
    2828
    2929namespace HeuristicLab.Selection {
     30  /// <summary>
     31  /// Base class for all selectors.
     32  /// </summary>
    3033  public abstract class SelectorBase : OperatorBase {
     34    /// <summary>
     35    /// Initializes a new instance of <see cref="SelectorBase"/> with one variable infos
     36    /// (<c>CopySelected</c>), which is a local one.
     37    /// </summary>
    3138    public SelectorBase()
    3239      : base() {
     
    3643    }
    3744
     45    /// <summary>
     46    /// Inserts a new level of sub scopes in the given <paramref name="scope"/> with a scope containing the
     47    /// remaining sub scopes and another with the selected ones.
     48    /// </summary>
     49    /// <remarks>Calls <see cref="Select"/>.</remarks>
     50    /// <param name="scope">The scope where to select the sub scopes.</param>
     51    /// <returns><c>null</c>.</returns>
    3852    public override IOperation Apply(IScope scope) {
    3953      BoolData copySelected = GetVariableValue<BoolData>("CopySelected", scope, true);
     
    5468    }
    5569
     70    /// <summary>
     71    /// Selects sub scopes from the specified <paramref name="source"/> and moves or copies it to the
     72    /// specified <paramref name="target"/>.
     73    /// </summary>
     74    /// <param name="source">The source scope where to select the sub scopes.</param>
     75    /// <param name="target">The target where to add the sub scopes.</param>
     76    /// <param name="copySelected">Boolean flag whether to copy or move the selected sub scopes.</param>
    5677    protected abstract void Select(IScope source, IScope target, bool copySelected);
    5778  }
  • trunk/sources/HeuristicLab.Selection/StochasticSelectorBase.cs

    r2 r817  
    2828
    2929namespace HeuristicLab.Selection {
     30  /// <summary>
     31  /// Base class for all selectors that use a random number generator.
     32  /// </summary>
    3033  public abstract class StochasticSelectorBase : SelectorBase {
     34    /// <summary>
     35    /// Initializes a new instance of <see cref="StochasticSelectorBase"/> with two variable infos
     36    /// (<c>Random</c> and <c>Selected</c>).
     37    /// </summary>
    3138    public StochasticSelectorBase()
    3239      : base() {
     
    3542    }
    3643
     44    /// <summary>
     45    /// Copies or moves randomly chosen sub scopes from the given <paramref name="source"/> to the specified
     46    /// <paramref name="target"/>.
     47    /// </summary>
     48    /// <remarks>Calls <see cref="Select(HeuristicLab.Core.IRandom, HeuristicLab.Core.IScope, int,
     49    /// HeuristicLab.Core.IScope, bool)"/></remarks>
     50    /// <param name="source">The source scope from where to copy/move the sub scopes.</param>
     51    /// <param name="target">The target scope where to add the sub scopes.</param>
     52    /// <param name="copySelected">Boolean flag whether the sub scopes shall be moved or copied.</param>
    3753    protected sealed override void Select(IScope source, IScope target, bool copySelected) {
    3854      IRandom random = GetVariableValue<IRandom>("Random", source, true);
     
    4258    }
    4359
     60    /// <summary>
     61    /// Copies or moves randomly chosen sub scopes from the given <paramref name="source"/> to the specified
     62    /// <paramref name="target"/>.
     63    /// </summary>
     64    /// <param name="random">The random number generator.</param>
     65    /// <param name="source">The source scope from where to copy/move the sub scopes.</param>
     66    /// <param name="selected">The number of sub scopes to copy/move.</param>
     67    /// <param name="target">The target scope where to add the sub scopes.</param>
     68    /// <param name="copySelected">Boolean flag whether the sub scopes shall be moved or copied.</param>
    4469    protected abstract void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected);
    4570  }
  • trunk/sources/HeuristicLab.Selection/TournamentSelector.cs

    r77 r817  
    2727
    2828namespace HeuristicLab.Selection {
     29  /// <summary>
     30  /// Moves or copies a defined number of the best sub scopes from a source scope to a target scope.
     31  /// </summary>
    2932  public class TournamentSelector : StochasticSelectorBase {
     33    /// <inheritdoc select="summary"/>
    3034    public override string Description {
    3135      get { return @"TODO\r\nOperator description still missing ..."; }
    3236    }
    3337
     38    /// <summary>
     39    /// Initializes a new instance of <see cref="TournamentSelector"/> with three variable infos
     40    /// (<c>Maximization</c>, <c>Quality</c> and <c>GroupSize</c>, being a local variable and set to
     41    /// <c>2</c>) with <c>CopySelected</c> set to <c>true</c>.
     42    /// </summary>
    3443    public TournamentSelector() {
    3544      AddVariableInfo(new VariableInfo("Maximization", "Maximization problem", typeof(BoolData), VariableKind.In));
     
    4150    }
    4251
     52    /// <summary>
     53    /// Copies or moves the best sub scopes from the given <paramref name="source"/> to the specified
     54    /// <paramref name="target"/>.
     55    /// </summary>
     56    /// <exception cref="InvalidOperationException">Thrown when no source sub scopes are available.</exception>
     57    /// <param name="random">The random number generator.</param>
     58    /// <param name="source">The source scope from where to copy/move the sub scopes.</param>
     59    /// <param name="selected">The number of sub scopes to copy/move.</param>
     60    /// <param name="target">The target scope where to add the sub scopes.</param>
     61    /// <param name="copySelected">Boolean flag whether the sub scopes shall be moved or copied.</param>
    4362    protected override void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected) {
    4463      IVariableInfo qualityInfo = GetVariableInfo("Quality");
Note: See TracChangeset for help on using the changeset viewer.