Changeset 11708
- Timestamp:
- 12/20/14 19:22:32 (10 years ago)
- Location:
- branches/HeuristicLab.Problems.GrammaticalOptimization
- Files:
-
- 11 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/GrammaticalOptimization.sln
r11659 r11708 9 9 EndProject 10 10 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Main", "Main\Main.csproj", "{524CBD70-6F99-46AF-AD00-A0BC9FD1175B}" 11 EndProject 12 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.Bandits", "HeuristicLab.Algorithms.Bandits\HeuristicLab.Algorithms.Bandits.csproj", "{24408F7D-EE0F-4886-A08B-EC324D662E47}" 11 13 EndProject 12 14 Global … … 32 34 {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 35 {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.Release|Any CPU.Build.0 = Release|Any CPU 36 {24408F7D-EE0F-4886-A08B-EC324D662E47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 {24408F7D-EE0F-4886-A08B-EC324D662E47}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 {24408F7D-EE0F-4886-A08B-EC324D662E47}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 {24408F7D-EE0F-4886-A08B-EC324D662E47}.Release|Any CPU.Build.0 = Release|Any CPU 34 40 EndGlobalSection 35 41 GlobalSection(SolutionProperties) = preSolution -
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization/ExhaustiveBreadthFirstSearch.cs
r11690 r11708 14 14 15 15 public ExhaustiveBreadthFirstSearch(int maxLen) { 16 this.maxLen = maxLen; 16 this.maxLen = maxLen; 17 17 } 18 18 … … 44 44 foreach (var alt in alts) { 45 45 var newPhrase = phrase.Remove(ntIdx, 1).Insert(ntIdx, alt); 46 if (newPhrase.All(grammar.IsTerminal) ) {46 if (newPhrase.All(grammar.IsTerminal) && newPhrase.Length <= maxLen) { 47 47 yield return newPhrase; 48 48 } else if (grammar.MinPhraseLength(newPhrase) <= maxLen) { -
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GrammaticalOptimization/ExhaustiveDepthFirstSearch.cs
r11690 r11708 14 14 15 15 public ExhaustiveDepthFirstSearch(int maxLen) { 16 this.maxLen = maxLen; 16 this.maxLen = maxLen; 17 17 } 18 18 … … 44 44 foreach (var alt in alts) { 45 45 var newPhrase = phrase.Remove(ntIdx, 1).Insert(ntIdx, alt); 46 if (newPhrase.All(grammar.IsTerminal) ) {46 if (newPhrase.All(grammar.IsTerminal) && newPhrase.Length <= maxLen) { 47 47 yield return newPhrase; 48 48 } else if (grammar.MinPhraseLength(newPhrase) <= maxLen) { -
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization.Test/HeuristicLab.Problems.GrammaticalOptimization.Test.csproj
r11659 r11708 57 57 </Choose> 58 58 <ItemGroup> 59 <Compile Include="TestBanditPolicies.cs" /> 59 60 <Compile Include="TestInstances.cs" /> 60 61 <Compile Include="Properties\AssemblyInfo.cs" /> 62 <Compile Include="TestSolvers.cs" /> 61 63 </ItemGroup> 62 64 <ItemGroup> 65 <ProjectReference Include="..\HeuristicLab.Algorithms.Bandits\HeuristicLab.Algorithms.Bandits.csproj"> 66 <Project>{24408f7d-ee0f-4886-a08b-ec324d662e47}</Project> 67 <Name>HeuristicLab.Algorithms.Bandits</Name> 68 </ProjectReference> 69 <ProjectReference Include="..\HeuristicLab.Algorithms.GrammaticalOptimization\HeuristicLab.Algorithms.GrammaticalOptimization.csproj"> 70 <Project>{eea07488-1a51-412a-a52c-53b754a628b3}</Project> 71 <Name>HeuristicLab.Algorithms.GrammaticalOptimization</Name> 72 </ProjectReference> 63 73 <ProjectReference Include="..\HeuristicLab.Problems.GrammaticalOptimization\HeuristicLab.Problems.GrammaticalOptimization.csproj"> 64 74 <Project>{cb9dccf6-667e-4a13-b82d-dbd6b45a045e}</Project> -
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/SantaFeAntProblem.cs
r11659 r11708 9 9 private const string grammarString = @" 10 10 G(A): 11 A -> l | r | m | ?(A)(A) | AA | AAA11 A -> l | r | m | ?(A)(A) | lA | rA | mA 12 12 "; 13 // original koza grammar 13 14 // Ant -> left | right | move | if-food-ahead Ant Ant | Ant Ant | Ant Ant Ant 15 // 16 // here we use a modified grammar which has only one syntax tree for each sentence 14 17 15 18 -
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/SymbolicRegressionPoly10Problem.cs
r11659 r11708 8 8 namespace HeuristicLab.Problems.GrammaticalOptimization { 9 9 public class SymbolicRegressionPoly10Problem : IProblem { 10 // length of the longest palindrome in the sentence + number of different symbols occurring in the palindrome11 10 private const string grammarString = @" 12 11 G(E): … … 14 13 V -> a .. j 15 14 "; 15 16 16 17 17 private readonly IGrammar grammar;
Note: See TracChangeset
for help on using the changeset viewer.