Changeset 12737
- Timestamp:
- 07/11/15 19:38:23 (9 years ago)
- Location:
- stable
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12650,12701
- Property svn:mergeinfo changed
-
stable/HeuristicLab 3.3.sln
r12733 r12737 75 75 {3B90F866-70F8-43EF-A541-51819D255B7B} = {3B90F866-70F8-43EF-A541-51819D255B7B} 76 76 {07486E68-1517-4B9D-A58D-A38E99AE71AB} = {07486E68-1517-4B9D-A58D-A38E99AE71AB} 77 {BE698769-975A-429E-828C-72BB2B6182C8} = {BE698769-975A-429E-828C-72BB2B6182C8} 77 78 {4AE3FC69-C575-42D2-BC46-0FAD5850EFC5} = {4AE3FC69-C575-42D2-BC46-0FAD5850EFC5} 78 79 {56F9106A-079F-4C61-92F6-86A84C2D84B7} = {56F9106A-079F-4C61-92F6-86A84C2D84B7} … … 419 420 EndProject 420 421 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.CMAEvolutionStrategy-3.4", "HeuristicLab.Algorithms.CMAEvolutionStrategy\3.4\HeuristicLab.Algorithms.CMAEvolutionStrategy-3.4.csproj", "{291010E4-2F4E-4D29-A795-753CFF293FDB}" 422 EndProject 423 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Encodings.LinearLinkageEncoding-3.3", "HeuristicLab.Encodings.LinearLinkageEncoding\3.3\HeuristicLab.Encodings.LinearLinkageEncoding-3.3.csproj", "{BE698769-975A-429E-828C-72BB2B6182C8}" 421 424 EndProject 422 425 Global … … 2038 2041 {291010E4-2F4E-4D29-A795-753CFF293FDB}.Release|x86.ActiveCfg = Release|x86 2039 2042 {291010E4-2F4E-4D29-A795-753CFF293FDB}.Release|x86.Build.0 = Release|x86 2043 {BE698769-975A-429E-828C-72BB2B6182C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 2044 {BE698769-975A-429E-828C-72BB2B6182C8}.Debug|Any CPU.Build.0 = Debug|Any CPU 2045 {BE698769-975A-429E-828C-72BB2B6182C8}.Debug|x64.ActiveCfg = Debug|x64 2046 {BE698769-975A-429E-828C-72BB2B6182C8}.Debug|x64.Build.0 = Debug|x64 2047 {BE698769-975A-429E-828C-72BB2B6182C8}.Debug|x86.ActiveCfg = Debug|x86 2048 {BE698769-975A-429E-828C-72BB2B6182C8}.Debug|x86.Build.0 = Debug|x86 2049 {BE698769-975A-429E-828C-72BB2B6182C8}.Release|Any CPU.ActiveCfg = Release|Any CPU 2050 {BE698769-975A-429E-828C-72BB2B6182C8}.Release|Any CPU.Build.0 = Release|Any CPU 2051 {BE698769-975A-429E-828C-72BB2B6182C8}.Release|x64.ActiveCfg = Release|x64 2052 {BE698769-975A-429E-828C-72BB2B6182C8}.Release|x64.Build.0 = Release|x64 2053 {BE698769-975A-429E-828C-72BB2B6182C8}.Release|x86.ActiveCfg = Release|x86 2054 {BE698769-975A-429E-828C-72BB2B6182C8}.Release|x86.Build.0 = Release|x86 2040 2055 EndGlobalSection 2041 2056 GlobalSection(SolutionProperties) = preSolution -
stable/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Crossovers/MultiLLECrossover.cs
r12286 r12737 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Reflection; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; … … 61 62 ChildParameter.ActualName = "LLE"; 62 63 63 foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ILinearLinkageCrossover) )) {64 foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ILinearLinkageCrossover), typeof(LinearLinkageEncoding).Assembly)) { 64 65 if (!typeof(MultiOperator<ILinearLinkageCrossover>).IsAssignableFrom(type)) 65 66 Operators.Add((ILinearLinkageCrossover)Activator.CreateInstance(type), true); -
stable/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/LinearLinkage.cs
r12650 r12737 77 77 78 78 /// <summary> 79 /// This method parses the encoded array and gathers all items that 80 /// belong to the same group as element <paramref name="index"/>. 81 /// </summary> 82 /// <param name="index">The element whose group should be returned.</param> 79 /// This method parses the encoded array and gathers all elements 80 /// that belong to the same group as element <paramref name="index"/>. 81 /// </summary> 82 /// <param name="index">The element whose group should be returned. 83 /// </param> 83 84 /// <returns>The element at <paramref name="index"/> and all other 84 85 /// elements in the same group.</returns> 85 86 public IEnumerable<int> GetGroup(int index) { 86 // return current element 87 yield return index; 88 var next = array[index]; 89 if (next == index) yield break; 90 int prev; 91 // return succeeding elements in group 92 do { 93 yield return next; 94 prev = next; 95 next = array[next]; 96 } while (next != prev); 97 next = array[index]; 98 // return preceding elements in group 99 for (prev = index - 1; prev >= 0; prev--) { 100 if (array[prev] != next) continue; 101 next = prev; 102 yield return next; 103 } 104 } 105 106 /// <summary> 107 /// This method parses the encoded array and gathers the item itself as 108 /// well as subsequent items that belong to the same group as element 109 /// <paramref name="index"/>. 110 /// </summary> 111 /// <param name="index">The element from which items in the group should 112 /// be returned.</param> 113 /// <returns>The element at <paramref name="index"/> and all subsequent 87 foreach (var n in GetGroupForward(index)) 88 yield return n; 89 // the element index has already been yielded 90 foreach (var n in GetGroupBackward(index).Skip(1)) 91 yield return n; 92 } 93 94 /// <summary> 95 /// This method parses the encoded array and gathers the element 96 /// <paramref name="index"/> as well as subsequent elements that 97 /// belong to the same group. 98 /// </summary> 99 /// <param name="index">The element from which subsequent (having a 100 /// larger number) elements in the group should be returned. 101 /// </param> 102 /// <returns>The element <paramref name="index"/> and all subsequent 114 103 /// elements in the same group.</returns> 115 104 public IEnumerable<int> GetGroupForward(int index) { … … 123 112 next = array[next]; 124 113 } while (next != prev); 114 } 115 116 /// <summary> 117 /// This method parses the encoded array and gathers the element 118 /// given <paramref name="index"/> as well as preceeding elements that 119 /// belong to the same group. 120 /// </summary> 121 /// <remarks> 122 /// Warning, this code has performance O(index) as the array has to 123 /// be fully traversed backwards from the given index. 124 /// </remarks> 125 /// <param name="index">The element from which preceeding (having a 126 /// smaller number) elements in the group should be returned. 127 /// </param> 128 /// <returns>The element <paramref name="index"/> and all preceeding 129 /// elements in the same group.</returns> 130 public IEnumerable<int> GetGroupBackward(int index) { 131 yield return index; 132 var next = array[index]; 133 // return preceding elements in group 134 for (var prev = index - 1; prev >= 0; prev--) { 135 if (array[prev] != next) continue; 136 next = prev; 137 yield return next; 138 } 125 139 } 126 140 -
stable/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Manipulators/MultiLLEManipulator.cs
r12288 r12737 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Reflection; 25 26 using HeuristicLab.Collections; 26 27 using HeuristicLab.Common; … … 53 54 : base() { 54 55 Parameters.Add(new LookupParameter<LinearLinkage>("LLE", "The encoding vector that is to be manipulated.")); 55 foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ILinearLinkageManipulator) )) {56 foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ILinearLinkageManipulator), typeof(LinearLinkageEncoding).Assembly)) { 56 57 if (!typeof(MultiOperator<ILinearLinkageManipulator>).IsAssignableFrom(type)) 57 58 Operators.Add((ILinearLinkageManipulator)Activator.CreateInstance(type), true); … … 59 60 Operators.SetItemCheckedState(Operators.OfType<SwapItemManipulator>().First(), false); 60 61 Operators.SetItemCheckedState(Operators.OfType<GraftManipulator>().First(), false); 61 SelectedOperatorParameter.ActualName = "SelectedManipulat orOperator";62 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 62 63 } 63 64
Note: See TracChangeset
for help on using the changeset viewer.