- Timestamp:
- 06/03/19 14:15:11 (5 years ago)
- 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 12 12 *.nuget.props 13 13 *.nuget.targets 14 Plugin.cs
-
- Property svn:ignore
-
branches/2988_ModelsOfModels2/HeuristicLab.Algorithms.EMM/EMMNetworkMap.cs
r16899 r17002 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 using HeuristicLab.Random; 26 27 using System.Collections.Generic; 27 28 … … 42 43 } 43 44 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 point46 // ModelSet = trees.ToList();47 // CalculateDistances();48 // NeghboorNumber = neghboorNumber; // this shoud be done before map creation, so it is impossible to create tree wisout it49 // 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 //}54 45 #endregion 55 46 #region MapTransformation 56 47 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); 62 49 } 63 public static void ApplyNetworkMapCreationAlgorithm(IRandom random, double[,] distances, List<List<int>> map, int k, intneghboorNumber = 10) {50 public static void ApplyNetworkMapCreationAlgorithm(IRandom random, double[,] distances, List<List<int>> map, int neghboorNumber = 10) { 64 51 int mapSize = distances.GetLength(0); 65 52 List<double> currentList = new List<double>(); … … 78 65 #endregion 79 66 #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); 82 73 return newTree; 83 74 }
Note: See TracChangeset
for help on using the changeset viewer.