Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10400


Ignore:
Timestamp:
01/26/14 14:37:40 (11 years ago)
Author:
gkronber
Message:

#2026 worked on MCTS solver

Location:
branches/HeuristicLab.Problems.GPDL/CodeGenerator
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GPDL/CodeGenerator/BruteForceCodeGen.cs

    r10394 r10400  
    9898        foreach(var t in GenerateTrees(0, depth)) {
    9999          var f = problem.Evaluate(t);
    100           // t.PrintTree(0); Console.WriteLine();
    101100          var size = t.GetSize();
    102101          sumSize += size;
     
    105104          sumF += f;
    106105          if (problem.IsBetter(f, bestF)) {
     106            t.PrintTree(0); Console.WriteLine();
    107107            bestF = f;
    108108            t.PrintTree(0); Console.WriteLine();
  • branches/HeuristicLab.Problems.GPDL/CodeGenerator/CodeGenerator.csproj

    r10388 r10400  
    3737  <ItemGroup>
    3838    <Compile Include="BruteForceCodeGen.cs" />
     39    <Compile Include="MonteCarloTreeSearchCodeGen.cs" />
    3940    <Compile Include="ProblemCodeGen.cs" />
    4041    <Compile Include="SourceBuilder.cs" />
  • branches/HeuristicLab.Problems.GPDL/CodeGenerator/ProblemCodeGen.cs

    r10394 r10400  
    149149    private void GenerateSolvers(GPDefNode ast, SourceBuilder solverSourceCode) {
    150150      var grammar = CreateGrammarFromAst(ast);
    151       //var randomSearchCodeGen = new RandomSearchCodeGen();
    152       //randomSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
    153       var bruteForceSearchCodeGen = new BruteForceCodeGen();
    154       bruteForceSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
     151      // var randomSearchCodeGen = new RandomSearchCodeGen();
     152      // randomSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
     153      //var bruteForceSearchCodeGen = new BruteForceCodeGen();
     154      //bruteForceSearchCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
     155      var mctsCodeGen = new MonteCarloTreeSearchCodeGen();
     156      mctsCodeGen.Generate(grammar, ast.Terminals.OfType<TerminalNode>(), ast.FitnessFunctionNode.Maximization, solverSourceCode);
    155157    }
    156158
  • branches/HeuristicLab.Problems.GPDL/CodeGenerator/RandomSearchCodeGen.cs

    r10388 r10400  
    124124      var sw = new System.Diagnostics.Stopwatch();
    125125      sw.Start();
    126       while (n <= 10000) {
     126      while (true) {
    127127
    128128        int steps, depth;
     
    136136        if (problem.IsBetter(f, bestF)) {
    137137          bestF = f;
     138          _t.PrintTree(0); Console.WriteLine();
    138139          Console.WriteLine(""{0}\t{1}\t(size={2}, depth={3})"", n, bestF, steps, depth);
    139140        }
Note: See TracChangeset for help on using the changeset viewer.