- Timestamp:
- 06/10/15 11:29:34 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.GrammaticalEvolution
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.GrammaticalEvolution ¶
-
TabularUnified trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.3/ArtificialAnt/GEArtificialAntEvaluator.cs ¶
r12012 r12422 49 49 } 50 50 // 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"]; } 53 53 } 54 54 public ILookupParameter<BoolMatrix> WorldParameter { … … 84 84 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the evaluated artificial ant solution.")); 85 85 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")); 87 87 Parameters.Add(new LookupParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items.")); 88 88 Parameters.Add(new LookupParameter<IntValue>("MaxTimeSteps", "The maximal number of time steps that the artificial ant should be simulated.")); … … 93 93 Parameters.Add(new LookupParameter<IntMatrix>("Bounds", "The integer number range in which the single genomes of a genotype are created.")); 94 94 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 95 110 } 96 111 -
TabularUnified trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.3/Mappers/GenotypeToPhenotypeMapper.cs ¶
r12012 r12422 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 32 using HeuristicLab.Problems.GrammaticalEvolution.Mappers; 33 using HeuristicLab.Random; 33 34 34 35 namespace HeuristicLab.Problems.GrammaticalEvolution { … … 68 69 if (!possibleSymbolsList.Any()) return null; 69 70 70 var newNode = possibleSymbolsList.S electRandom(random).CreateTreeNode();71 var newNode = possibleSymbolsList.SampleRandom(random).CreateTreeNode(); 71 72 if (newNode.HasLocalParameters) newNode.ResetLocalParameters(random); 72 73 return newNode; -
TabularUnified trunk/sources/HeuristicLab.Problems.GrammaticalEvolution/3.3/Mappers/RandomMapper.cs ¶
r12012 r12422 29 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Random; 31 32 32 33 namespace HeuristicLab.Problems.GrammaticalEvolution { … … 102 103 } else { 103 104 // similar to PIGEMapper, but here the current node is determined randomly ... 104 ISymbolicExpressionTreeNode current = nonTerminals.S electRandom(random);105 ISymbolicExpressionTreeNode current = nonTerminals.SampleRandom(random); 105 106 nonTerminals.Remove(current); 106 107
Note: See TracChangeset
for help on using the changeset viewer.