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/EMMMutators.cs

    r16899 r17002  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    2625using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2726using HeuristicLab.Parameters;
    2827using HeuristicLab.Problems.DataAnalysis.Symbolic;
    29 using HeuristicLab.Random;
    3028using System.Collections.Generic;
    3129using System.Linq;
     
    4341
    4442    public List<ISymbolicExpressionTree> ModelSet => MapParameter.ActualValue.ModelSet;
    45     public List<int> ClusterNumber => MapParameter.ActualValue.ClusterNumber;
    4643    public List<List<int>> Map => MapParameter.ActualValue.Map;
    4744
     
    5855
    5956    protected override void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
    60       EMMMutatorsPart(random, symbolicExpressionTree, ModelSet, ClusterNumber, Map);
     57      EMMMutatorsPart(random, symbolicExpressionTree, ModelSet, Map);
    6158    }
    62     public static void EMMMutatorsPart(IRandom random, ISymbolicExpressionTree symbolicExpressionTree, List<ISymbolicExpressionTree> modelSet, List<int> clusterNumber, List<List<int>> map) {
     59    public void EMMMutatorsPart(IRandom random, ISymbolicExpressionTree symbolicExpressionTree, List<ISymbolicExpressionTree> modelSet, List<List<int>> map) {
    6360      List<ISymbol> allowedSymbols = new List<ISymbol>();
    6461      ISymbolicExpressionTreeNode parent;
     
    109106
    110107        if (newNode is TreeModelTreeNode treeNode) {
    111           int p = random.Next(map.Count);
    112           if (child is TreeModelTreeNode chNode) { p = chNode.ClusterNumer; }
    113           treeNode.TreeNumber = map[p].SampleRandom(random);
    114           treeNode.Tree = (ISymbolicExpressionTree)modelSet[treeNode.TreeNumber].Clone();
    115           treeNode.ClusterNumer = p;
    116           treeNode.SetLocalParameters(random, 0.5);
     108          int p = random.Next(modelSet.Count);
     109          if (child is TreeModelTreeNode chNode) { p = chNode.TreeNumber; }
     110          treeNode.TreeNumber = p;
     111          MapParameter.ActualValue.NodeForMutationChange(random, treeNode);
    117112        } else if (newNode.HasLocalParameters)
    118113          newNode.ResetLocalParameters(random);
Note: See TracChangeset for help on using the changeset viewer.