- Timestamp:
- 03/03/17 18:41:01 (8 years ago)
- Location:
- branches/PersistenceOverhaul
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceOverhaul/HeuristicLab.Algorithms.ALPS/3.3/AgingScheme.cs
r14712 r14713 24 24 using System.Linq; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 27 27 28 namespace HeuristicLab.Algorithms.ALPS { … … 29 30 /// Defines the growth of age limits for the layers. 30 31 /// </summary> 32 [StorableType("58FBD063-B765-439D-BEC8-C718E6877EBD")] 31 33 public enum AgingScheme { 32 34 Linear, -
branches/PersistenceOverhaul/HeuristicLab.Optimization.Operators/3.3/NoSimilarityCalculator.cs
r14712 r14713 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 25 25 26 namespace HeuristicLab.Optimization.Operators { … … 30 31 /// The item always considers two solutions to be distinct. 31 32 /// </remarks> 33 [StorableType("88771671-7DEF-4E1D-89F1-851E05F1BCA3")] 32 34 [Item("NoSimilarityCalculator", "An item that performs similarity calculation between two solutions. The item always considers two solutions to be distinct.")] 33 35 public sealed class NoSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { -
branches/PersistenceOverhaul/HeuristicLab.Optimization.Operators/3.3/QualitySimilarityCalculator.cs
r14712 r14713 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 27 27 28 namespace HeuristicLab.Optimization.Operators { … … 32 33 /// The item always considers two solutions to be equal if they have the same quality. 33 34 /// </remarks> 35 [StorableType("64D9B8A0-D350-4B31-B56B-2EE7DAA8E970")] 34 36 [Item("QualitySimilarityCalculator", "An item that performs similarity calculation between two solutions. The item only considers the qualities of the two solutions.")] 35 37 public sealed class QualitySimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r14711 r14713 21 21 22 22 using System; 23 using System.CodeDom; 23 24 using System.Collections.Generic; 24 25 using System.Linq; … … 69 70 /// </returns> 70 71 public bool CanSerialize(Type type) { 71 var markedStorable = StorableReflection.HasStorableClassAttribute(type) ;72 var markedStorable = StorableReflection.HasStorableClassAttribute(type) && !type.IsEnum && !type.IsValueType; 72 73 if (GetConstructor(type) == null) 73 74 if (markedStorable) -
branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs
r14711 r14713 113 113 // RegisterType(new Guid("3B3AA69E-1641-4202-AE1D-7EEFF60FA355"), typeof(double[])); 114 114 // RegisterType(new Guid("7DF325A6-2553-4915-B7C6-D98191107CB7"), typeof(string[])); 115 116 RegisterType(new Guid("E451A99B-0CFD-48E6-9BEF-0AE9D1E73628"), typeof(IList)); 115 117 RegisterType(new Guid("DB2A785C-5803-42C7-A01F-E1FD845A83A1"), typeof(List<>)); 116 118 RegisterType(new Guid("EB98A564-BEDC-458A-9E9B-4BF3CDAFB9BE"), typeof(Stack<>)); … … 121 123 RegisterType(new Guid("7E2F3277-7216-4295-A498-9ACA43527D5B"), typeof(HashSet<>)); 122 124 RegisterType(new Guid("E92C35AD-32B1-4F37-B8D2-BE2F5FEB465B"), typeof(Dictionary<,>)); 125 RegisterType(new Guid("18504ADF-2332-4497-8CA0-B2F00CA2EBA2"), typeof(Type)); 123 126 124 127 var allTypes = new Dictionary<string, Type>(5000); … … 162 165 RegisterType(new Guid("00C8C940-63D9-43FF-99BA-9C69301BF043"), allTypes["System.Collections.Generic.RandomizedObjectEqualityComparer"]); 163 166 RegisterType(new Guid("DAF22757-7FCC-49AC-B148-F3DD7E9E0A3B"), allTypes["System.Collections.Generic.IEqualityComparer`1"]); 164 165 167 166 168 //var registeredTypes = type2Guid.Keys.ToArray(); -
branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Transformers/StorableClassTransformer.cs
r14711 r14713 30 30 internal sealed class StorableClassBoxTransformer : BoxTransformer<object> { 31 31 public override bool CanTransformType(Type type) { 32 return StorableTypeAttribute.IsStorableType(type) && !type.IsValueType || // don't transform structs32 return StorableTypeAttribute.IsStorableType(type) && !type.IsValueType && !type.IsEnum || // don't transform structs or enums 33 33 type.BaseType != null && CanTransformType(type.BaseType); 34 34 } -
branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSolutionsAnalyzer.cs
r12012 r14713 33 33 34 34 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 35 [StorableType("604417B8-FBAD-407C-8482-D39959159551")] 35 36 public class SymbolicRegressionSolutionsAnalyzer : SingleSuccessorOperator, IAnalyzer { 36 37 private const string ResultCollectionParameterName = "Results"; -
branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionContextAwareCrossover.cs
r12422 r14713 34 34 "- Randomly choose a node N from P1\n" + 35 35 "- Test all crossover points from P0 to determine the best location for N to be inserted")] 36 [StorableType("510A36FF-584C-40F6-B3E0-5D7B0F85D761")] 36 37 public sealed class SymbolicDataAnalysisExpressionContextAwareCrossover<T> : SymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData { 37 38 [StorableConstructor] -
branches/PersistenceOverhaul/HeuristicLab.Problems.Knapsack/3.3/SimilarityCalculators/KnapsackSimilarityCalculator.cs
r12070 r14713 25 25 using HeuristicLab.Encodings.BinaryVectorEncoding; 26 26 using HeuristicLab.Optimization.Operators; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 28 29 namespace HeuristicLab.Problems.Knapsack { … … 34 35 /// </remarks> 35 36 [Item("KnapsackSimilarityCalculator", "An operator that performs similarity calculation between two knapsack solutions. The operator calculates the similarity based on the number of elements the two solutions have in common.")] 37 [StorableType("E335A90A-13BB-48C6-9BD3-4D183E8EB370")] 36 38 public sealed class KnapsackSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 37 39 protected override bool IsCommutative { get { return true; } } -
branches/PersistenceOverhaul/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPSimilarityCalculator.cs
r12070 r14713 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 26 using HeuristicLab.Optimization.Operators; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 28 29 namespace HeuristicLab.Problems.QuadraticAssignment { … … 34 35 /// </remarks> 35 36 [Item("QAPSimilarityCalculator", "An operator that performs similarity calculation between two quadratic assignment solutions. The operator calculates the similarity based on the number of edges the two solutions have in common.")] 37 [StorableType("EC8B94E6-EA4D-4EA4-86E5-9386F5CE54FE")] 36 38 public sealed class QAPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 37 39 protected override bool IsCommutative { get { return true; } } -
branches/PersistenceOverhaul/HeuristicLab.Problems.TravelingSalesman/3.3/SimilarityCalculators/TSPSimilarityCalculator.cs
r12070 r14713 25 25 using HeuristicLab.Encodings.PermutationEncoding; 26 26 using HeuristicLab.Optimization.Operators; 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 28 28 29 namespace HeuristicLab.Problems.TravelingSalesman { … … 33 34 /// The operator calculates the similarity based on the number of edges the two solutions have in common. 34 35 /// </remarks> 36 [StorableType("D5AD7A09-5738-4F14-AB3C-4943C32FACC6")] 35 37 [Item("TSPSimilarityCalculator", "An operator that performs similarity calculation between two traveling salesman solutions. The operator calculates the similarity based on the number of edges the two solutions have in common.")] 36 38 public sealed class TSPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { -
branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs
r14711 r14713 32 32 using System.Threading.Tasks; 33 33 using HeuristicLab.Algorithms.GeneticAlgorithm; 34 using HeuristicLab.Common; 34 35 using HeuristicLab.Data; 35 36 using HeuristicLab.Persistence; … … 403 404 404 405 public string Profile(Func<object> GenerateDataFunc) { 405 int nrOfRepetitions = 30;406 int nrOfRepetitions = 1; 406 407 StringBuilder report = new StringBuilder(); 407 408 List<PerformanceData> dataList = new List<PerformanceData>(); … … 2134 2135 foreach (var fileName in Directory.EnumerateFiles(path, "*.hl")) { 2135 2136 var original = XmlParser.Deserialize(fileName); 2136 serializer.Serialize(original, fileName + ".proto"); 2137 // var newVersion = serializer.Deserialize(fileName + ".proto"); 2138 var p = Profile(() => original); 2139 Console.WriteLine(p); 2137 var ok = true; 2138 foreach (var t in original.GetObjectGraphObjects().Select(o => o.GetType())) { 2139 if ( 2140 t.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) 2141 .Any(ctor => StorableConstructorAttribute.IsStorableConstructor(ctor))) { 2142 try { 2143 if (t.IsGenericType) 2144 { 2145 var g = Mapper.StaticCache.GetGuid(t.GetGenericTypeDefinition()); 2146 } 2147 else 2148 { 2149 var g = Mapper.StaticCache.GetGuid(t); 2150 } 2151 } catch (Exception e) { 2152 Console.WriteLine(t.FullName); 2153 ok = false; 2154 } 2155 } 2156 } 2157 if (ok) { 2158 serializer.Serialize(original, fileName + ".proto"); 2159 // var newVersion = serializer.Deserialize(fileName + ".proto"); 2160 var p = Profile(() => original); 2161 Console.WriteLine(p); 2162 } 2140 2163 } 2141 2164 }
Note: See TracChangeset
for help on using the changeset viewer.