Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Core/3.3/OperatorLibrary.cs @ 2553

Last change on this file since 2553 was 2546, checked in by swagner, 15 years ago

Continued work on Optimizer and on adapting all views to the new MainForm concept (#770)

File size: 2.4 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Text;
25using System.Xml;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27
28namespace HeuristicLab.Core {
29  /// <summary>
30  /// Represents a library of operators consisting of one <see cref="IOperatorGroup"/>.
31  /// </summary>
32  [Creatable("Libraries")]
33  [Item("Operator Library", "A library that contains multiple operators.")]
34  public class OperatorLibrary : ItemBase, IOperatorLibrary {
35
36    [Storable]
37    private IOperatorGroup myGroup;
38    /// <summary>
39    /// Gets the operator group of the current instance.
40    /// </summary>
41    public IOperatorGroup Group {
42      get { return myGroup; }
43    }
44
45    /// <summary>
46    /// Initializes a new instance of <see cref="OperatorLibrary"/>.
47    /// </summary>
48    public OperatorLibrary() {
49      myGroup = new OperatorGroup();
50    }
51
52    /// <summary>
53    /// Clones the current instance (deep clone).
54    /// </summary>
55    /// <remarks>Deep clone through <see cref="cloner.Clone"/> method of helper class
56    /// <see cref="Auxiliary"/>.</remarks>
57    /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param>
58    /// <returns>The cloned object as <see cref="OperatorLibrary"/>.</returns>
59    public override IItem Clone(ICloner cloner) {
60      OperatorLibrary clone = new OperatorLibrary();
61      cloner.RegisterClonedObject(this, clone);
62      clone.myGroup = (IOperatorGroup)cloner.Clone(Group);
63      return clone;
64    }
65  }
66}
Note: See TracBrowser for help on using the repository browser.