Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/03/19 14:15:11 (5 years ago)
Author:
msemenki
Message:

#2988:
Class HelpFuction get new static functions that are used in different Map’s classes and possible in other classes.
Branch was adapted to Hive.
New version of class structure for Maps:

  1. 3 new variants of maps (RankMap, SuccessMap and ZeroMap) are added.
  2. BaseMap class was simplified, some class members were deleted and other were transported to child class, because some of them are not used in all kinds of maps.
  3. Functions between base class and child class were divided in other way.
  4. Mutation operators were adapted to work with new class structure. Now mutation make less work for ModelNodes than previously.
  5. ModelNode and Model symbols were simplified. They should not take into account a map type.
  6. Models frequency analyzers were adapted for new variants of maps.
  7. EMMAlgorithm class was adapted to new maps
Location:
branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.EMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.EMM

    • Property svn:ignore
      •  

        old new  
        1212*.nuget.props
        1313*.nuget.targets
         14Plugin.cs
  • branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.EMM/EMMNetworkMap.cs

    r16899 r17002  
    2424using HeuristicLab.Core;
    2525using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     26using HeuristicLab.Random;
    2627using System.Collections.Generic;
    2728
     
    4243    }
    4344    public EMMNetworkMap(EMMNetworkMap original, Cloner cloner) : base(original, cloner) { NeghboorNumber = original.NeghboorNumber; }
    44     //public EMMNetworkMap(IRandom random, IEnumerable<ISymbolicExpressionTree> trees, int k, int neghboorNumber = 10) : this(neghboorNumber) {
    45     //  // constructor that should be used in case of creation of a new map from the start point
    46     //  ModelSet = trees.ToList();
    47     //  CalculateDistances();
    48     //  NeghboorNumber = neghboorNumber; // this shoud be done before map creation, so it is impossible to create tree wisout it
    49     //  CreateMap(random, k);
    50     //}
    51     //public EMMNetworkMap(IRandom random, IEnumerable<ISymbolicExpressionTree> trees, string fileName = "Map.txt") : base(random, trees, fileName) {
    52     //  NeghboorNumber = Map[0].Count;
    53     //}
    5445    #endregion
    5546    #region MapTransformation
    5647    override public void CreateMap(IRandom random, int k) {
    57       K = Map.Count;
    58       ApplyNetworkMapCreationAlgorithm(random, Distances, Map, K, NeghboorNumber);
    59       for (int i = 0; i < Map.Count; i++) {
    60         ClusterNumber.Add(i);
    61       }
     48      ApplyNetworkMapCreationAlgorithm(random, CalculateDistances(), Map, NeghboorNumber);
    6249    }
    63     public static void ApplyNetworkMapCreationAlgorithm(IRandom random, double[,] distances, List<List<int>> map, int k, int neghboorNumber = 10) {
     50    public static void ApplyNetworkMapCreationAlgorithm(IRandom random, double[,] distances, List<List<int>> map, int neghboorNumber = 10) {
    6451      int mapSize = distances.GetLength(0);
    6552      List<double> currentList = new List<double>();
     
    7865    #endregion
    7966    #region Dialog with surroudings
    80     override public ISymbolicExpressionTree NewModelForInizializtionNotTree(IRandom random, out int cluster, out int treeNumber) {
    81       var newTree = NewModelForInizializtion(random, out cluster, out treeNumber);
     67    public override ISymbolicExpressionTree NewModelForMutation(IRandom random, out int treeNumber, int parentTreeNumber) {
     68      treeNumber = Map[parentTreeNumber].SampleRandom(random);
     69      return (ISymbolicExpressionTree)ModelSet[treeNumber].Clone();
     70    }
     71    override public ISymbolicExpressionTree NewModelForInizializtionNotTree(IRandom random, out int treeNumber) {
     72      var newTree = NewModelForInizializtion(random, out treeNumber);
    8273      return newTree;
    8374    }
Note: See TracChangeset for help on using the changeset viewer.