Changeset 14714


Ignore:
Timestamp:
03/06/17 10:19:39 (2 years ago)
Author:
gkronber
Message:

#2520: added missing StorableType attributes and registered more types. All samples can be deserialized and serialized now

Location:
branches/PersistenceOverhaul
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceOverhaul/HeuristicLab.Common/3.3/TypeEqualityComparer.cs

    r12012 r14714  
    2121
    2222using System.Collections.Generic;
     23using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2324
    2425namespace HeuristicLab.Common {
     26  [StorableType("968BC42A-2453-43B9-92E1-3C52C6CF3AED")]
    2527  public class TypeEqualityComparer<T> : IEqualityComparer<T> {
    2628
  • branches/PersistenceOverhaul/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Grammars/SimpleSymbolicExpressionGrammar.cs

    r12422 r14714  
    2525
    2626namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     27  [StorableType("6A92B935-5D05-42D8-933C-333C9AB71133")]
    2728  public sealed class SimpleSymbolicExpressionGrammar : SymbolicExpressionGrammar {
    2829    [StorableConstructor]
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/StaticCache.cs

    r14713 r14714  
    5858      // 
    5959      // 
    60       //  "B7313EE2-045F-41C9-AEC9-7B1A8CDBF90F"
    61       //  "D5265599-7380-4A28-AB0D-9F336EF290C5"
    62       //  "6A92B935-5D05-42D8-933C-333C9AB71133"
    63       //  "934A44AA-7E04-4E2D-B640-EDD3DE24894F"
     60      // 
     61      // 
     62      // 
     63      // 
    6464      //  "0F24C888-AF34-4318-9472-187B9AA85F3C"
    6565
     
    114114      // RegisterType(new Guid("7DF325A6-2553-4915-B7C6-D98191107CB7"), typeof(string[]));
    115115
    116       RegisterType(new Guid("E451A99B-0CFD-48E6-9BEF-0AE9D1E73628"), typeof(IList));                                       
     116      RegisterType(new Guid("E451A99B-0CFD-48E6-9BEF-0AE9D1E73628"), typeof(IList));
     117      RegisterType(new Guid("B7313EE2-045F-41C9-AEC9-7B1A8CDBF90F"), typeof(IEnumerable));
     118      RegisterType(new Guid("D5265599-7380-4A28-AB0D-9F336EF290C5"), typeof(IEnumerable<>));
    117119      RegisterType(new Guid("DB2A785C-5803-42C7-A01F-E1FD845A83A1"), typeof(List<>));
    118120      RegisterType(new Guid("EB98A564-BEDC-458A-9E9B-4BF3CDAFB9BE"), typeof(Stack<>));
  • branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/MultiSymbolicDataAnalysisExpressionCreator.cs

    r12108 r14714  
    3535
    3636namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Creators {
     37  [StorableType("4F300624-6101-48BB-9BC0-6CE4D2711963")]
    3738  public class MultiSymbolicDataAnalysisExpressionCreator : StochasticMultiBranch<ISymbolicDataAnalysisSolutionCreator>,
    3839    ISymbolicDataAnalysisSolutionCreator,
  • branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionCrossover.cs

    r12012 r14714  
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     34  [StorableType("F1795C23-8338-4EDA-98AF-1690569C7AE3")]
    3435  public abstract class SymbolicDataAnalysisExpressionCrossover<T> : SymbolicExpressionTreeCrossover, ISymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
    3536    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
  • branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDepthConstrainedCrossover.cs

    r12422 r14714  
    3232
    3333namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     34  [StorableType("86C1312C-1CDA-4B24-92C5-9112E6EAE2EF")]
    3435  [Item("DepthConstrainedCrossover", "An operator which performs subtree swapping within a specific depth range. The range parameter controls the crossover behavior:\n" +
    3536                                     "- HighLevel (upper 25% of the tree)\n" +
  • branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDeterministicBestCrossover.cs

    r12422 r14714  
    3030
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     32  [StorableType("4A26C31E-8D8D-4142-B7A7-2D6E363635B8")]
    3233  [Item("DeterministicBestCrossover", "An operator which performs subtree swapping by choosing the best subtree to be swapped in a certain position:\n" +
    3334                                      "- Take two parent individuals P0 and P1\n" +
  • branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs

    r12422 r14714  
    3030
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     32  [StorableType("BCD67FE9-1F9C-4208-8F7C-AF7FFA7D7170")]
    3233  [Item("ProbabilisticFunctionalCrossover", "An operator which performs subtree swapping based on the behavioral similarity between subtrees:\n" +
    3334                                            "- Take two parent individuals P0 and P1\n" +
  • branches/PersistenceOverhaul/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs

    r12422 r14714  
    3131
    3232namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     33  [StorableType("461F207C-057D-4E95-A803-D66457AE3806")]
    3334  [Item("SemanticSimilarityCrossover", "An operator which performs subtree swapping based on the notion semantic similarity between subtrees\n" +
    3435                                       "(criteria: mean of the absolute differences between the estimated output values of the two subtrees, falling into a user-defined range)\n" +
  • branches/PersistenceOverhaul/HeuristicLab.Problems.Orienteering/3.3/Analyzers/BestOrienteeringSolutionAnalyzer.cs

    r14712 r14714  
    3131
    3232namespace HeuristicLab.Problems.Orienteering {
     33  [StorableType("934A44AA-7E04-4E2D-B640-EDD3DE24894F")]
    3334  public sealed class BestOrienteeringSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
    3435    public bool EnabledByDefault {
  • branches/PersistenceOverhaul/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs

    r14713 r14714  
    404404
    405405    public string Profile(Func<object> GenerateDataFunc) {
    406       int nrOfRepetitions = 1;
     406      int nrOfRepetitions = 30;
    407407      StringBuilder report = new StringBuilder();
    408408      List<PerformanceData> dataList = new List<PerformanceData>();
     
    21362136        var original = XmlParser.Deserialize(fileName);
    21372137        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         }
     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        //         var g = Mapper.StaticCache.GetGuid(t.GetGenericTypeDefinition());
     2145        //       } else {
     2146        //         var g = Mapper.StaticCache.GetGuid(t);
     2147        //       }
     2148        //     } catch (Exception e) {
     2149        //       Console.WriteLine(t.FullName);
     2150        //       ok = false;
     2151        //     }
     2152        //   }
     2153        // }
    21572154        if (ok) {
    21582155          serializer.Serialize(original, fileName + ".proto");
Note: See TracChangeset for help on using the changeset viewer.