- Timestamp:
- 09/21/11 15:51:43 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Grammars.cs
r6803 r6814 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.DataAnalysis.Symbolic; 26 28 27 29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding_3._4.Tests { … … 212 214 213 215 public static ISymbolicExpressionGrammar CreateSimpleArithmeticGrammar() { 214 var g = new SimpleArithmeticGrammar(); 216 var g = new TypeCoherentExpressionGrammar(); 217 g.ConfigureAsDefaultRegressionGrammar(); 218 g.Symbols.OfType<Variable>().First().Enabled = false; 219 //var g = new SimpleArithmeticGrammar(); 215 220 g.MaximumFunctionArguments = 0; 216 221 g.MinimumFunctionArguments = 0; … … 221 226 222 227 public static ISymbolicExpressionGrammar CreateArithmeticAndAdfGrammar() { 223 var g = new SimpleArithmeticGrammar(); 228 var g = new TypeCoherentExpressionGrammar(); 229 g.ConfigureAsDefaultRegressionGrammar(); 230 g.Symbols.OfType<Variable>().First().Enabled = false; 224 231 g.MaximumFunctionArguments = 3; 225 232 g.MinimumFunctionArguments = 0; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.Tests.csproj
r5809 r6814 149 149 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 150 150 </ProjectReference> 151 <ProjectReference Include="..\..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj"> 152 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project> 153 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name> 154 </ProjectReference> 151 155 <ProjectReference Include="..\..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj"> 152 156 <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project> -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/ProbabilisticTreeCreaterTest.cs
r5809 r6814 72 72 Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine 73 73 ); 74 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 500); // must achieve more than 500 random trees / s74 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 300); // must achieve more than 500 random trees / s 75 75 } 76 76 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Tests/Util.cs
r6803 r6814 153 153 public static void IsValid(ISymbolicExpressionTreeGrammar grammar) { 154 154 Assert.IsTrue(grammar.Symbols.Count() == grammar.Symbols.Distinct().Count()); 155 foreach (ISymbol symbol in grammar. Symbols) {155 foreach (ISymbol symbol in grammar.AllowedSymbols) { 156 156 Assert.IsTrue(grammar.GetMinimumSubtreeCount(symbol) <= grammar.GetMaximumExpressionLength(symbol)); 157 157 Assert.IsTrue(grammar.GetAllowedChildSymbols(symbol).Count() == grammar.GetAllowedChildSymbols(symbol).Distinct().Count());
Note: See TracChangeset
for help on using the changeset viewer.