- Timestamp:
- 08/11/15 10:11:47 (9 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:ignore
-
old new 23 23 bin 24 24 protoc.exe 25 obj
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Crossovers/MultiLLECrossover.cs
r12286 r12843 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); -
branches/HiveStatistics/sources/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/LinearLinkage.cs
r12650 r12843 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 -
branches/HiveStatistics/sources/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Manipulators/MultiLLEManipulator.cs
r12288 r12843 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); 58 59 } 59 Operators.SetItemCheckedState(Operators.OfType<SwapItemManipulator>().First(), false); 60 Operators.SetItemCheckedState(Operators.OfType<GraftManipulator>().First(), false); 61 SelectedOperatorParameter.ActualName = "SelectedManipulatorOperator"; 60 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 62 61 } 63 62 -
branches/HiveStatistics/sources/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Plugin.cs.frame
r12288 r12843 23 23 24 24 namespace HeuristicLab.Encodings.LinearLinkageEncoding { 25 [Plugin("HeuristicLab.Encodings.LinearLinkageEncoding", "Provides data structures and operators for the linear linkage encoding (LLE).", "3.3.1 1.$WCREV$")]25 [Plugin("HeuristicLab.Encodings.LinearLinkageEncoding", "Provides data structures and operators for the linear linkage encoding (LLE).", "3.3.12.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Encodings.LinearLinkageEncoding-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/HiveStatistics/sources/HeuristicLab.Encodings.LinearLinkageEncoding/3.3/Properties/AssemblyInfo.cs.frame
r12285 r12843 54 54 // [assembly: AssemblyVersion("1.0.*")] 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3.1 1.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.