Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/16/09 11:24:03 (16 years ago)
Author:
vdorfer
Message:

Created API documentation for HeuristicLab.Random, HeuristicLab.SGA and HeuristicLab.Selection.OffspringSelection namespace (#331)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SGA/SGA.cs

    r65 r1153  
    3333
    3434namespace HeuristicLab.SGA {
     35  /// <summary>
     36  /// Class for the heuristic optimization technique "simple genetic algorithm".
     37  /// </summary>
    3538  public class SGA : ItemBase, IEditable {
    3639    #region Create Operators
     40    /// <summary>
     41    /// Creates operators for the current instance.
     42    /// </summary>
     43    /// <param name="engine">The engine where to add the operators.</param>
    3744    public static void Create(IEngine engine) {
    3845      engine.OperatorGraph.Clear();
     
    355362    #region Properties
    356363    private IEngine myEngine;
     364    /// <summary>
     365    /// Gets the engine of the current instance.
     366    /// </summary>
    357367    public IEngine Engine {
    358368      get { return myEngine; }
    359369    }
    360370    private BoolData mySetSeedRandomly;
     371    /// <summary>
     372    /// Gets or sets the flag whether to set the seed randomly or not.
     373    /// </summary>
    361374    public bool SetSeedRandomly {
    362375      get { return mySetSeedRandomly.Data; }
     
    364377    }
    365378    private IntData mySeed;
     379    /// <summary>
     380    /// Gets or sets the value of the seed of the current instance.
     381    /// </summary>
    366382    public int Seed {
    367383      get { return mySeed.Data; }
     
    370386    private IntData myPopulationSize;
    371387    private IntData myParents;
     388    /// <summary>
     389    /// Gets or sets the population size of the current instance.
     390    /// </summary>
     391    /// <remarks>The number of parents is set to two times the population size.</remarks>
    372392    public int PopulationSize {
    373393      get { return myPopulationSize.Data; }
     
    378398    }
    379399    private IntData myMaximumGenerations;
     400    /// <summary>
     401    /// Gets or sets the number of maximum generations.
     402    /// </summary>
    380403    public int MaximumGenerations {
    381404      get { return myMaximumGenerations.Data; }
     
    383406    }
    384407    private DoubleData myMutationRate;
     408    /// <summary>
     409    /// Gets or sets the mutation rate of the current instance.
     410    /// </summary>
    385411    public double MutationRate {
    386412      get { return myMutationRate.Data; }
     
    388414    }
    389415    private IntData myElites;
     416    /// <summary>
     417    /// Gets or sets the elites of the current instance.
     418    /// </summary>
    390419    public int Elites {
    391420      get { return myElites.Data; }
     
    394423    private CombinedOperator mySGA;
    395424    private IOperator myVariableInjection;
     425    /// <summary>
     426    /// Gets or sets the problem injector of the current instance.
     427    /// </summary>
    396428    public IOperator ProblemInjector {
    397429      get { return myVariableInjection.SubOperators[0]; }
     
    404436    }
    405437    private IOperator myPopulationInitialization;
     438    /// <summary>
     439    /// Gets or sets the solution generator of the current instance.
     440    /// </summary>
    406441    public IOperator SolutionGenerator {
    407442      get { return myPopulationInitialization.SubOperators[0]; }
     
    413448      }
    414449    }
     450    /// <summary>
     451    /// Gets or sets the evaluator of the current instance.
     452    /// </summary>
    415453    public IOperator Evaluator {
    416454      get { return myPopulationInitialization.SubOperators[1]; }
     
    424462    }
    425463    private IOperator mySGAMain;
     464    /// <summary>
     465    /// Gets or sets the selection operator of the current instance.
     466    /// </summary>
    426467    public IOperator Selector {
    427468      get { return mySGAMain.SubOperators[0]; }
     
    433474      }
    434475    }
     476    /// <summary>
     477    /// Gets or sets the crossover operator of the current instance.
     478    /// </summary>
    435479    public IOperator Crossover {
    436480      get { return mySGAMain.SubOperators[1]; }
     
    442486      }
    443487    }
     488    /// <summary>
     489    /// Gets or sets the mutation operator of the current instance.
     490    /// </summary>
    444491    public IOperator Mutator {
    445492      get { return mySGAMain.SubOperators[2]; }
     
    453500    #endregion
    454501
     502    /// <summary>
     503    /// Initializes a new instance of <see cref="SGA"/>.
     504    /// </summary>
    455505    public SGA() {
    456506      myEngine = new SequentialEngine.SequentialEngine();
     
    459509    }
    460510
     511    /// <summary>
     512    /// Creates a new instance of the <see cref="SGAEditor"/> class.
     513    /// </summary>
     514    /// <returns>The created instance of the <see cref="SGAEditor"/>.</returns>
    461515    public override IView CreateView() {
    462516      return new SGAEditor(this);
    463517    }
     518    /// <summary>
     519    /// Creates a new instance of the <see cref="SGAEditor"/> class.
     520    /// </summary>
     521    /// <returns>The created instance of the <see cref="SGAEditor"/>.</returns>
    464522    public virtual IEditor CreateEditor() {
    465523      return new SGAEditor(this);
    466524    }
    467525
     526    /// <summary>
     527    /// Clones the current instance (deep clone).
     528    /// </summary>
     529    /// <remarks>Deep clone through <see cref="Auxiliary.Clone"/> method of helper class
     530    /// <see cref="Auxiliary"/>.</remarks>
     531    /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param>
     532    /// <returns>The cloned object as <see cref="SGA"/>.</returns>
    468533    public override object Clone(IDictionary<Guid, object> clonedObjects) {
    469534      SGA clone = new SGA();
     
    506571
    507572    #region Persistence Methods
     573    /// <summary>
     574    /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
     575    /// </summary>
     576    /// <remarks>The engine of the current instance is saved as a child node with the tag name
     577    /// <c>Engine</c>.</remarks>
     578    /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
     579    /// <param name="document">The <see cref="XmlDocument"/> where the data is saved.</param>
     580    /// <param name="persistedObjects">A dictionary of all already persisted objects. (Needed to avoid cycles.)</param>
     581    /// <returns>The saved <see cref="XmlNode"/>.</returns>
    508582    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    509583      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
     
    511585      return node;
    512586    }
     587    /// <summary>
     588    /// Loads the persisted instance from the specified <paramref name="node"/>.
     589    /// </summary>
     590    /// <remarks>The elements of the current instance must be saved in a special way, see
     591    /// <see cref="GetXmlNode"/>.</remarks>
     592    /// <param name="node">The <see cref="XmlNode"/> where the instance is saved.</param>
     593    /// <param name="restoredObjects">The dictionary of all already restored objects. (Needed to avoid cycles.)</param>
    513594    public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) {
    514595      base.Populate(node, restoredObjects);
Note: See TracChangeset for help on using the changeset viewer.