Changeset 1078 for branches/3.1/sources
- Timestamp:
- 01/07/09 13:09:55 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.1/sources/HeuristicLab.ES/ES.cs
r98 r1078 35 35 36 36 namespace HeuristicLab.ES { 37 /// <summary> 38 /// Class for the heuristic optimization technique "evolution strategy". 39 /// </summary> 37 40 public class ES : ItemBase, IEditable { 38 41 #region Create Operators 42 /// <summary> 43 /// Creates a new evolution strategy. 44 /// </summary> 45 /// <param name="engine">The engine of the ES to create.</param> 39 46 public static void Create(IEngine engine) { 40 47 engine.OperatorGraph.Clear(); … … 373 380 #region Properties 374 381 private IEngine myEngine; 382 /// <summary> 383 /// Gets the engine of the current instance. 384 /// </summary> 375 385 public IEngine Engine { 376 386 get { return myEngine; } 377 387 } 378 388 private BoolData mySetSeedRandomly; 389 /// <summary> 390 /// Gets or sets the boolean flag whether to set the seed randomly or not. 391 /// </summary> 379 392 public bool SetSeedRandomly { 380 393 get { return mySetSeedRandomly.Data; } … … 382 395 } 383 396 private IntData mySeed; 397 /// <summary> 398 /// Gets or sets the seed of the current instance. 399 /// </summary> 400 /// <remarks>Calls <see cref="ItemBase.OnChanged"/> of base class <see cref="ItemBase"/> 401 /// in the setter.</remarks> 384 402 public int Seed { 385 403 get { return mySeed.Data; } … … 390 408 } 391 409 private IntData myMu; 410 /// <summary> 411 /// Gets or sets the µ value of the current instance. 412 /// </summary> 413 /// <remarks>Sets also the lambda and the rho value. Calls <see cref="ItemBase.OnChanged"/> of 414 /// base class <see cref="ItemBase"/>.</remarks> 392 415 public int Mu { 393 416 get { return myMu.Data; } … … 402 425 } 403 426 private IntData myRho; 427 /// <summary> 428 /// Gets or sets the rho value of the current instance. 429 /// </summary> 430 /// <remarks>Sets also the µ value. Calls <see cref="ItemBase.OnChanged"/> of 431 /// base class <see cref="ItemBase"/>.</remarks> 404 432 public int Rho { 405 433 get { return myRho.Data; } … … 413 441 } 414 442 private IntData myLambda; 443 /// <summary> 444 /// Gets or sets the lambda value of the current instance. 445 /// </summary> 446 /// <remarks>May also change the µ value under certain circumstances. 447 /// Calls <see cref="ItemBase.OnChanged"/> of base class <see cref="ItemBase"/>.</remarks> 415 448 public int Lambda { 416 449 get { return myLambda.Data; } … … 434 467 } 435 468 private BoolData myPlusNotation; 469 /// <summary> 470 /// Gets or sets the boolean flag whether it is a plus notation or not. 471 /// </summary> 472 /// <remarks>May also set the lambda value under certain circumstances. 473 /// Calls <see cref="ItemBase.OnChanged"/> of base class <see cref="ItemBase"/>.</remarks> 436 474 public bool PlusNotation { 437 475 get { return myPlusNotation.Data; } … … 447 485 } 448 486 private DoubleData myShakingFactor; 487 /// <summary> 488 /// Gets or sets the shaking factor of the current instance. 489 /// </summary> 449 490 public double ShakingFactor { 450 491 get { return myShakingFactor.Data; } … … 452 493 } 453 494 private DoubleData mySuccessProbability; 495 454 496 private DoubleData myTargetSuccessProbability; 497 /// <summary> 498 /// Gets or sets the success probability. 499 /// </summary> 500 /// <remarks>Gets the target success probability and sets also the target success probability.</remarks> 455 501 public double SuccessProbability { 456 502 get { return myTargetSuccessProbability.Data; } … … 461 507 } 462 508 private DoubleData myLearningRate; 509 /// <summary> 510 /// Gets or sets the learning rate. 511 /// </summary> 512 /// <remarks>Calls <see cref="ItemBase.OnChanged"/> of base class <see cref="ItemBase"/> 513 /// in the setter.</remarks> 463 514 public double LearningRate { 464 515 get { return myLearningRate.Data; } … … 471 522 } 472 523 private DoubleData myDampeningFactor; 524 /// <summary> 525 /// Gets or sets the dampening factor. 526 /// </summary> 527 /// <remarks>Calls <see cref="ItemBase.OnChanged"/> of base class <see cref="ItemBase"/> 528 /// in the setter.</remarks> 473 529 public double DampeningFactor { 474 530 get { return myDampeningFactor.Data; } … … 481 537 } 482 538 private IntData myMaximumGenerations; 539 /// <summary> 540 /// Gets or sets the maximum number of generations. 541 /// </summary> 483 542 public int MaximumGenerations { 484 543 get { return myMaximumGenerations.Data; } … … 486 545 } 487 546 private BoolData myUseSuccessRule; 547 /// <summary> 548 /// Gets or sets the boolean flag whether to use the success rule or not. 549 /// </summary> 488 550 public bool UseSuccessRule { 489 551 get { return myUseSuccessRule.Data; } … … 493 555 private IOperator myESMain; 494 556 private IOperator myVariableInjection; 557 /// <summary> 558 /// Gets or sets the problem injection operator. 559 /// </summary> 495 560 public IOperator ProblemInjector { 496 561 get { return myVariableInjection.SubOperators[0]; } … … 503 568 } 504 569 private IOperator myPopulationInitialization; 570 /// <summary> 571 /// Gets or sets the solution generation operator. 572 /// </summary> 505 573 public IOperator SolutionGenerator { 506 574 get { return myPopulationInitialization.SubOperators[0]; } … … 512 580 } 513 581 } 582 /// <summary> 583 /// Gets or sets the evaluation operator. 584 /// </summary> 514 585 public IOperator Evaluator { 515 586 get { return myPopulationInitialization.SubOperators[1]; } … … 522 593 } 523 594 } 595 /// <summary> 596 /// Gets or sets the mutation operator. 597 /// </summary> 524 598 public IOperator Mutator { 525 599 get { return myESMain.SubOperators[0]; } … … 531 605 } 532 606 } 607 /// <summary> 608 /// Gets or sets the recombination operator. 609 /// </summary> 533 610 public IOperator Recombinator { 534 611 get { return myESMain.SubOperators[2]; } … … 542 619 #endregion 543 620 621 /// <summary> 622 /// Initializes a new instance of <see cref="ES"/> having a <see cref="SequentialEngine"/> as engine. 623 /// </summary> 544 624 public ES() { 545 625 myEngine = new SequentialEngine.SequentialEngine(); … … 548 628 } 549 629 630 /// <summary> 631 /// Creates a new instance of <see cref="ESEditor"/> to display the current instance. 632 /// </summary> 633 /// <returns>The created view as <see cref="ESEditor"/>.</returns> 550 634 public override IView CreateView() { 551 635 return new ESEditor(this); 552 636 } 637 /// <summary> 638 /// Creates a new instance of <see cref="ESEditor"/> to display the current instance. 639 /// </summary> 640 /// <returns>The created editor as <see cref="ESEditor"/>.</returns> 553 641 public virtual IEditor CreateEditor() { 554 642 return new ESEditor(this); 555 643 } 556 644 645 /// <summary> 646 /// Clones the current instance (deep clone). 647 /// </summary> 648 /// <remarks>Uses <see cref="Auxiliary.Clone"/> method of the <see cref="Auxiliary"/> class to 649 /// clone the engine.</remarks> 650 /// <param name="clonedObjects">A dictionary of all already cloned objects. 651 /// (Needed to avoid cycles.)</param> 652 /// <returns>The cloned object as <see cref="ES"/>.</returns> 557 653 public override object Clone(IDictionary<Guid, object> clonedObjects) { 558 654 ES clone = new ES(); … … 601 697 602 698 #region Persistence Methods 699 /// <summary> 700 /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>. 701 /// </summary> 702 /// <remarks>Calls <see cref="StorableBase.GetXmlNode"/> of base class <see cref="ItemBase"/>. 703 /// <br/>The engine of the current instance is saved as child node with tag name <c>Engine</c>.</remarks> 704 /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param> 705 /// <param name="document">The <see cref="XmlDocument"/> where to save the data.</param> 706 /// <param name="persistedObjects">The dictionary of all already persisted objects. 707 /// (Needed to avoid cycles.)</param> 708 /// <returns>The saved <see cref="XmlNode"/>.</returns> 603 709 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 604 710 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 606 712 return node; 607 713 } 714 /// <summary> 715 /// Loads the persisted ES from the specified <paramref name="node"/>. 716 /// </summary> 717 /// <remarks>Calls <see cref="StorableBase.Populate"/> of base class <see cref="ItemBase"/>.<br/> 718 /// The engine must be saved as child node with tag name <c>Engine</c> (see 719 /// <see cref="GetXmlNode"/>).</remarks> 720 /// <param name="node">The <see cref="XmlNode"/> where the value is saved.</param> 721 /// <param name="restoredObjects">The dictionary of all already restored objects. 722 /// (Needed to avoid cycles.)</param> 608 723 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 609 724 base.Populate(node, restoredObjects);
Note: See TracChangeset
for help on using the changeset viewer.