Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/10/15 11:29:34 (10 years ago)
Author:
mkommend
Message:

#2320: Merged the encoding class and all accompanying changes in the trunk.

Location:
trunk/sources/HeuristicLab.Problems.GrammaticalEvolution
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.GrammaticalEvolution

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/SymbolicExpressionTreeEncoding/HeuristicLab.Problems.GrammaticalEvolutionmergedeligible
      /stable/HeuristicLab.Problems.GrammaticalEvolutionmergedeligible
      /branches/1721-RandomForestPersistence/HeuristicLab.Problems.GrammaticalEvolution10321-10322
      /branches/Algorithms.GradientDescent/HeuristicLab.Problems.GrammaticalEvolution5516-5520
      /branches/Benchmarking/sources/HeuristicLab.Problems.GrammaticalEvolution6917-7005
      /branches/CloningRefactoring/HeuristicLab.Problems.GrammaticalEvolution4656-4721
      /branches/CodeEditor/HeuristicLab.Problems.GrammaticalEvolution11700-11806
      /branches/DataAnalysis Refactoring/HeuristicLab.Problems.GrammaticalEvolution5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Problems.GrammaticalEvolution5815-6180
      /branches/DataAnalysis/HeuristicLab.Problems.GrammaticalEvolution4458-4459,​4462,​4464
      /branches/DataPreprocessing/HeuristicLab.Problems.GrammaticalEvolution10085-11101
      /branches/GP.Grammar.Editor/HeuristicLab.Problems.GrammaticalEvolution6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.GrammaticalEvolution5060
      /branches/HLScript/HeuristicLab.Problems.GrammaticalEvolution10331-10358
      /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Problems.GrammaticalEvolution6123-9799
      /branches/LogResidualEvaluator/HeuristicLab.Problems.GrammaticalEvolution10202-10483
      /branches/NET40/sources/HeuristicLab.Problems.GrammaticalEvolution5138-5162
      /branches/NSGA-II Changes/HeuristicLab.Problems.GrammaticalEvolution12033-12122
      /branches/ParallelEngine/HeuristicLab.Problems.GrammaticalEvolution5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.GrammaticalEvolution7568-7810
      /branches/QAPAlgorithms/HeuristicLab.Problems.GrammaticalEvolution6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Problems.GrammaticalEvolution6828
      /branches/RuntimeOptimizer/HeuristicLab.Problems.GrammaticalEvolution8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.GrammaticalEvolution7787-8333
      /branches/SlaveShutdown/HeuristicLab.Problems.GrammaticalEvolution8944-8956
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Problems.GrammaticalEvolution10204-10479
      /branches/SuccessProgressAnalysis/HeuristicLab.Problems.GrammaticalEvolution5370-5682
      /branches/Trunk/HeuristicLab.Problems.GrammaticalEvolution6829-6865
      /branches/UnloadJobs/HeuristicLab.Problems.GrammaticalEvolution9168-9215
      /branches/VNS/HeuristicLab.Problems.GrammaticalEvolution5594-5752
      /branches/histogram/HeuristicLab.Problems.GrammaticalEvolution5959-6341
  • trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.3/ArtificialAnt/GEArtificialAntEvaluator.cs

    r12012 r12422  
    4949    }
    5050    // phenotype:
    51     public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
    52       get { return (ILookupParameter<SymbolicExpressionTree>)Parameters["SymbolicExpressionTree"]; }
     51    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
     52      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters["SymbolicExpressionTree"]; }
    5353    }
    5454    public ILookupParameter<BoolMatrix> WorldParameter {
     
    8484      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the evaluated artificial ant solution."));
    8585      Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The artificial ant solution encoded as an integer vector genome."));
    86       Parameters.Add(new LookupParameter<SymbolicExpressionTree>("SymbolicExpressionTree", "The artificial ant solution encoded as a symbolic expression tree that should be evaluated"));
     86      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>("SymbolicExpressionTree", "The artificial ant solution encoded as a symbolic expression tree that should be evaluated"));
    8787      Parameters.Add(new LookupParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items."));
    8888      Parameters.Add(new LookupParameter<IntValue>("MaxTimeSteps", "The maximal number of time steps that the artificial ant should be simulated."));
     
    9393      Parameters.Add(new LookupParameter<IntMatrix>("Bounds", "The integer number range in which the single genomes of a genotype are created."));
    9494      Parameters.Add(new LookupParameter<IntValue>("MaximumExpressionLength", "Maximal length of the expression to control the artificial ant (genotype length)."));
     95    }
     96
     97    [StorableHook(HookType.AfterDeserialization)]
     98    private void AfterDeserialization() {
     99      // BackwardsCompatibility3.3
     100      #region Backwards compatible code, remove with 3.4
     101
     102      if (Parameters.ContainsKey("SymbolicExpressionTree") &&
     103          Parameters["SymbolicExpressionTree"] is ILookupParameter<SymbolicExpressionTree>) {
     104        Parameters.Remove("SymbolicExpressionTree");
     105        Parameters.Add(new LookupParameter<ISymbolicExpressionTree>("SymbolicExpressionTree", "The artificial ant solution encoded as a symbolic expression tree that should be evaluated"));
     106      }
     107
     108      #endregion
     109
    95110    }
    96111
  • trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.3/Mappers/GenotypeToPhenotypeMapper.cs

    r12012 r12422  
    3131using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3232using HeuristicLab.Problems.GrammaticalEvolution.Mappers;
     33using HeuristicLab.Random;
    3334
    3435namespace HeuristicLab.Problems.GrammaticalEvolution {
     
    6869      if (!possibleSymbolsList.Any()) return null;
    6970
    70       var newNode = possibleSymbolsList.SelectRandom(random).CreateTreeNode();
     71      var newNode = possibleSymbolsList.SampleRandom(random).CreateTreeNode();
    7172      if (newNode.HasLocalParameters) newNode.ResetLocalParameters(random);
    7273      return newNode;
  • trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.3/Mappers/RandomMapper.cs

    r12012 r12422  
    2929using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    3030using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     31using HeuristicLab.Random;
    3132
    3233namespace HeuristicLab.Problems.GrammaticalEvolution {
     
    102103        } else {
    103104          // similar to PIGEMapper, but here the current node is determined randomly ...
    104           ISymbolicExpressionTreeNode current = nonTerminals.SelectRandom(random);
     105          ISymbolicExpressionTreeNode current = nonTerminals.SampleRandom(random);
    105106          nonTerminals.Remove(current);
    106107
Note: See TracChangeset for help on using the changeset viewer.