- Timestamp:
- 07/10/15 12:11:55 (9 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12305,12393,12397-12401,12504,12506,12512,12622,12649,12664
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/HLScript/HeuristicLab.Core merged eligible /trunk/sources/HeuristicLab.Core merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Core 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.Core 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Core 6917-7005 /branches/CloningRefactoring/HeuristicLab.Core 4656-4721 /branches/CodeEditor/HeuristicLab.Core 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.Core 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Core 5815-6180 /branches/DataAnalysis/HeuristicLab.Core 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.Core 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.Core 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Core 5060 /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Core 11570-12508 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Core 6123-9799 /branches/LogResidualEvaluator/HeuristicLab.Core 10202-10483 /branches/NET40/sources/HeuristicLab.Core 5138-5162 /branches/NSGA-II Changes/HeuristicLab.Core 12033-12122 /branches/NewItemDialog/HeuristicLab.Core 12240,12246 /branches/ParallelEngine/HeuristicLab.Core 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Core 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Core 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Core 6828 /branches/RuntimeOptimizer/HeuristicLab.Core 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Core 7787-8333 /branches/SlaveShutdown/HeuristicLab.Core 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Core 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.Core 5370-5682 /branches/Trunk/HeuristicLab.Core 6829-6865 /branches/UnloadJobs/HeuristicLab.Core 9168-9215 /branches/VNS/HeuristicLab.Core 5594-5752 /branches/histogram/HeuristicLab.Core 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
stable/HeuristicLab.Core/3.3/Attributes/CreatableAttribute.cs
r12009 r12708 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 23 25 24 26 namespace HeuristicLab.Core { 25 27 [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] 26 28 public sealed class CreatableAttribute : Attribute { 29 #region Predefined Categories 30 public static class Categories { 31 public const string SplitToken = "###"; 32 public const string OrderToken = "$$$"; 33 34 public const string Algorithms = "1" + OrderToken + "Algorithms"; 35 public const string PopulationBasedAlgorithms = Algorithms + SplitToken + "1" + OrderToken + "Population Based"; 36 public const string SingleSolutionAlgorithms = Algorithms + SplitToken + "2" + OrderToken + "Single Solution"; 37 38 public const string Problems = "2" + OrderToken + "Problems"; 39 public const string CombinatorialProblems = Problems + SplitToken + "1" + OrderToken + "Combinatorial"; 40 public const string GeneticProgrammingProblems = Problems + SplitToken + "2" + OrderToken + "Genetic Programming"; 41 public const string ExternalEvaluationProblems = Problems + SplitToken + "3" + OrderToken + "External Evaluation"; 42 43 public const string DataAnalysis = "3" + OrderToken + "Data Analysis"; 44 public const string DataAnalysisRegression = DataAnalysis + SplitToken + "1" + OrderToken + "Regression"; 45 public const string DataAnalysisClassification = DataAnalysis + SplitToken + "2" + OrderToken + "Classification"; 46 public const string DataAnalysisEnsembles = DataAnalysis + SplitToken + "3" + OrderToken + "Ensembles"; 47 48 public const string TestingAndAnalysis = "4" + OrderToken + "Testing & Analysis"; 49 public const string TestingAndAnalysisOKB = TestingAndAnalysis + SplitToken + "1" + OrderToken + "OKB"; 50 51 public const string Scripts = "5" + OrderToken + "Scripts"; 52 53 public static string GetFullName(string rawName) { 54 return string.Join(SplitToken, GetTokens(rawName)); 55 } 56 public static string GetName(string rawName) { 57 return GetTokens(rawName).Last(); 58 } 59 public static IEnumerable<string> GetParentRawNames(string rawName) { 60 var tokens = GetTokensWithOrdering(rawName).ToList(); 61 return tokens.Take(tokens.Count - 1); 62 } 63 private static IEnumerable<string> GetTokensWithOrdering(string rawName) { 64 return rawName.Split(new[] { SplitToken }, StringSplitOptions.RemoveEmptyEntries); 65 } 66 private static IEnumerable<string> GetTokens(string rawName) { 67 return GetTokensWithOrdering(rawName) 68 .Select(t => t.Split(new[] { OrderToken }, StringSplitOptions.RemoveEmptyEntries).Last()); 69 } 70 } 71 #endregion 72 27 73 private string category; 28 74 public string Category { … … 36 82 } 37 83 84 public int Priority { get; set; } 85 38 86 public CreatableAttribute() { 39 87 Category = "Other Items"; 88 Priority = int.MaxValue; 40 89 } 41 90 public CreatableAttribute(string category) … … 53 102 else return null; 54 103 } 104 public static int GetPriority(Type type) { 105 var attribs = type.GetCustomAttributes(typeof(CreatableAttribute), false); 106 if (attribs.Length > 0) return ((CreatableAttribute)attribs[0]).Priority; 107 else return int.MaxValue; 108 } 55 109 } 56 110 }
Note: See TracChangeset
for help on using the changeset viewer.