Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/EnumerableItem.cs @ 16116

Last change on this file since 16116 was 10142, checked in by mkommend, 10 years ago

#1997: Worked on symbolic data analysis island algorithms:

  • Refactored and removed unnecessary code in symbolic island GA and symbolic island GA evaluator.
  • Added EnumerableItem to ease the passing of rows to the actual evaluator.
  • Added prototype of island offspring selection GA.
  • Corrected build configuration (plugin classes, project settings, ...)
File size: 1.9 KB
Line 
1#region License Information
2
3/* HeuristicLab
4 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
5 *
6 * This file is part of HeuristicLab.
7 *
8 * HeuristicLab is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * HeuristicLab is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#endregion
23
24using System.Collections.Generic;
25using HeuristicLab.Common;
26using HeuristicLab.Core;
27
28namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
29  public sealed class EnumerableItem<T> : Item, IEnumerable<T> where T : struct {
30
31    private readonly IEnumerable<T> enumerable;
32    public IEnumerable<T> Enumerable {
33      get { return enumerable; }
34    }
35
36    private EnumerableItem(EnumerableItem<T> original, Cloner cloner)
37      : base(original, cloner) {
38      enumerable = original.enumerable;
39    }
40
41    public override IDeepCloneable Clone(Cloner cloner) {
42      return new EnumerableItem<T>(this, cloner);
43    }
44
45    public EnumerableItem(IEnumerable<T> enumerable) {
46      this.enumerable = enumerable;
47    }
48
49    #region IEnumerable<T> Members
50    public IEnumerator<T> GetEnumerator() {
51      return enumerable.GetEnumerator();
52    }
53    #endregion
54
55    #region IEnumerable Members
56    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
57      return enumerable.GetEnumerator();
58    }
59    #endregion
60  }
61}
Note: See TracBrowser for help on using the repository browser.