- Timestamp:
- 11/26/08 10:29:34 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Selection/ProportionalSelector.cs
r772 r817 27 27 28 28 namespace 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> 29 33 public class ProportionalSelector : StochasticSelectorBase { 34 /// <inheritdoc select="summary"/> 30 35 public override string Description { 31 36 get { return @"TODO\r\nOperator description still missing ..."; } 32 37 } 33 38 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> 34 44 public ProportionalSelector() { 35 45 AddVariableInfo(new VariableInfo("Maximization", "Maximization problem", typeof(BoolData), VariableKind.In)); … … 41 51 } 42 52 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> 43 63 protected override void Select(IRandom random, IScope source, int selected, IScope target, bool copySelected) { 44 64 bool maximization = GetVariableValue<BoolData>("Maximization", source, true).Data; … … 74 94 } 75 95 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> 76 108 private void GenerateQualitiesArray(IScope source, bool maximization, IVariableInfo qualityInfo, bool windowing, out double[] qualities, out double qualitySum) { 77 109 int subScopes = source.SubScopes.Count;
Note: See TracChangeset
for help on using the changeset viewer.