Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.EMM/EMMIslandMap.cs @ 16899

Last change on this file since 16899 was 16899, checked in by msemenki, 5 years ago

#2988: New version of class structure.

File size: 2.6 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2019 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 HEAL.Attic;
23using HeuristicLab.Common;
24using HeuristicLab.Core;
25using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
26using System.Collections.Generic;
27
28namespace HeuristicLab.Algorithms.EvolvmentModelsOfModels {
29  [Item("IslandMap", "A map of models of models of models")]
30  [StorableType("E4AB04B9-FD5D-47EE-949D-243660754F3A")]
31  public class EMMIslandMap : EMMMapBase<ISymbolicExpressionTree> {
32    #region conctructors
33    [StorableConstructor]
34    protected EMMIslandMap(StorableConstructorFlag _) : base(_) { }
35    public EMMIslandMap() : this(1) { }
36    public override IDeepCloneable Clone(Cloner cloner) {
37      return new EMMIslandMap(this, cloner);
38    }
39    public EMMIslandMap(int k) : base(k) { ModelSet = new List<ISymbolicExpressionTree>(); }
40    public EMMIslandMap(EMMIslandMap original, Cloner cloner) : base(original, cloner) { }
41    // public EMMIslandMap(IRandom random, IEnumerable<ISymbolicExpressionTree> trees, int k, int neghboorNumber) : base(random, trees, k) { }
42    //public EMMIslandMap(IRandom random, IEnumerable<ISymbolicExpressionTree> trees, string fileName = "Map.txt") : base(random, trees, fileName) { }
43    #endregion
44    #region MapApplayFunctions
45    override public void CreateMap(IRandom random, int k) {
46      K = EMModelsClusterizationAlgorithm.ApplyClusteringAlgorithm(random, Distances, ClusterNumber, k);
47      MapSizeCheck();
48      for (int i = 0; i < ModelSet.Count; i++) {
49        Map[ClusterNumber[i]].Add(i);
50      }
51    }
52    override public ISymbolicExpressionTree NewModelForInizializtionNotTree(IRandom random, out int cluster, out int treeNumber) {
53      return NewModelForInizializtion(random, out cluster, out treeNumber);
54    }
55    #endregion
56
57  }
58}
Note: See TracBrowser for help on using the repository browser.