Changeset 12503


Ignore:
Timestamp:
06/23/15 20:00:14 (7 years ago)
Author:
aballeit
Message:

#2283 added GUI and charts; fixed MCTS

Location:
branches/HeuristicLab.Problems.GrammaticalOptimization
Files:
473 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GrammaticalOptimization/GrammaticalOptimization.sln

    r12099 r12503  
    6868  EndProjectSection
    6969EndProject
     70Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Evaluation", "Evaluation\Evaluation.csproj", "{D043325A-097F-4512-A8FC-CF706577FA46}"
     71EndProject
     72Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicDataDisplay", "DynamicDataDisplay\DynamicDataDisplay.csproj", "{ECD37682-DF7E-409F-912D-0965634556B5}"
     73EndProject
    7074Global
    7175  GlobalSection(SolutionConfigurationPlatforms) = preSolution
    7276    Debug|Any CPU = Debug|Any CPU
    7377    Release|Any CPU = Release|Any CPU
     78    ReleaseXBAP|Any CPU = ReleaseXBAP|Any CPU
    7479  EndGlobalSection
    7580  GlobalSection(ProjectConfigurationPlatforms) = postSolution
     
    7883    {CB9DCCF6-667E-4A13-B82D-DBD6B45A045E}.Release|Any CPU.ActiveCfg = Release|Any CPU
    7984    {CB9DCCF6-667E-4A13-B82D-DBD6B45A045E}.Release|Any CPU.Build.0 = Release|Any CPU
     85    {CB9DCCF6-667E-4A13-B82D-DBD6B45A045E}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     86    {CB9DCCF6-667E-4A13-B82D-DBD6B45A045E}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    8087    {EEA07488-1A51-412A-A52C-53B754A628B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    8188    {EEA07488-1A51-412A-A52C-53B754A628B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
    8289    {EEA07488-1A51-412A-A52C-53B754A628B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
    8390    {EEA07488-1A51-412A-A52C-53B754A628B3}.Release|Any CPU.Build.0 = Release|Any CPU
     91    {EEA07488-1A51-412A-A52C-53B754A628B3}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     92    {EEA07488-1A51-412A-A52C-53B754A628B3}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    8493    {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    8594    {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.Debug|Any CPU.Build.0 = Debug|Any CPU
    8695    {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.Release|Any CPU.ActiveCfg = Release|Any CPU
    8796    {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.Release|Any CPU.Build.0 = Release|Any CPU
     97    {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     98    {524CBD70-6F99-46AF-AD00-A0BC9FD1175B}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    8899    {24408F7D-EE0F-4886-A08B-EC324D662E47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    89100    {24408F7D-EE0F-4886-A08B-EC324D662E47}.Debug|Any CPU.Build.0 = Debug|Any CPU
    90101    {24408F7D-EE0F-4886-A08B-EC324D662E47}.Release|Any CPU.ActiveCfg = Release|Any CPU
    91102    {24408F7D-EE0F-4886-A08B-EC324D662E47}.Release|Any CPU.Build.0 = Release|Any CPU
     103    {24408F7D-EE0F-4886-A08B-EC324D662E47}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     104    {24408F7D-EE0F-4886-A08B-EC324D662E47}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    92105    {3A2FBBCB-F9DF-4970-87F3-F13337D941AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    93106    {3A2FBBCB-F9DF-4970-87F3-F13337D941AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
    94107    {3A2FBBCB-F9DF-4970-87F3-F13337D941AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
    95108    {3A2FBBCB-F9DF-4970-87F3-F13337D941AD}.Release|Any CPU.Build.0 = Release|Any CPU
     109    {3A2FBBCB-F9DF-4970-87F3-F13337D941AD}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     110    {3A2FBBCB-F9DF-4970-87F3-F13337D941AD}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    96111    {17A7A380-86CE-482D-8D22-CBD70CC97F0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    97112    {17A7A380-86CE-482D-8D22-CBD70CC97F0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
    98113    {17A7A380-86CE-482D-8D22-CBD70CC97F0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
    99114    {17A7A380-86CE-482D-8D22-CBD70CC97F0D}.Release|Any CPU.Build.0 = Release|Any CPU
     115    {17A7A380-86CE-482D-8D22-CBD70CC97F0D}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     116    {17A7A380-86CE-482D-8D22-CBD70CC97F0D}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    100117    {14BEC23F-63FD-4954-B8AE-E2F4962E9B57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    101118    {14BEC23F-63FD-4954-B8AE-E2F4962E9B57}.Debug|Any CPU.Build.0 = Debug|Any CPU
    102119    {14BEC23F-63FD-4954-B8AE-E2F4962E9B57}.Release|Any CPU.ActiveCfg = Release|Any CPU
    103120    {14BEC23F-63FD-4954-B8AE-E2F4962E9B57}.Release|Any CPU.Build.0 = Release|Any CPU
     121    {14BEC23F-63FD-4954-B8AE-E2F4962E9B57}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     122    {14BEC23F-63FD-4954-B8AE-E2F4962E9B57}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    104123    {31171165-E16F-4A1A-A8AB-25C6AB3A71B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    105124    {31171165-E16F-4A1A-A8AB-25C6AB3A71B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
    106125    {31171165-E16F-4A1A-A8AB-25C6AB3A71B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
    107126    {31171165-E16F-4A1A-A8AB-25C6AB3A71B9}.Release|Any CPU.Build.0 = Release|Any CPU
     127    {31171165-E16F-4A1A-A8AB-25C6AB3A71B9}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     128    {31171165-E16F-4A1A-A8AB-25C6AB3A71B9}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    108129    {E8138227-0C64-4E85-B676-21D3B97F254F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    109130    {E8138227-0C64-4E85-B676-21D3B97F254F}.Debug|Any CPU.Build.0 = Debug|Any CPU
    110131    {E8138227-0C64-4E85-B676-21D3B97F254F}.Release|Any CPU.ActiveCfg = Release|Any CPU
    111132    {E8138227-0C64-4E85-B676-21D3B97F254F}.Release|Any CPU.Build.0 = Release|Any CPU
     133    {E8138227-0C64-4E85-B676-21D3B97F254F}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     134    {E8138227-0C64-4E85-B676-21D3B97F254F}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    112135    {8B4C199E-C08B-479E-9B82-6AE5B113459E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    113136    {8B4C199E-C08B-479E-9B82-6AE5B113459E}.Debug|Any CPU.Build.0 = Debug|Any CPU
    114137    {8B4C199E-C08B-479E-9B82-6AE5B113459E}.Release|Any CPU.ActiveCfg = Release|Any CPU
    115138    {8B4C199E-C08B-479E-9B82-6AE5B113459E}.Release|Any CPU.Build.0 = Release|Any CPU
     139    {8B4C199E-C08B-479E-9B82-6AE5B113459E}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     140    {8B4C199E-C08B-479E-9B82-6AE5B113459E}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
    116141    {2C115235-8FA9-4F7F-B3A0-A0144F8A35CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    117142    {2C115235-8FA9-4F7F-B3A0-A0144F8A35CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
    118143    {2C115235-8FA9-4F7F-B3A0-A0144F8A35CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
    119144    {2C115235-8FA9-4F7F-B3A0-A0144F8A35CA}.Release|Any CPU.Build.0 = Release|Any CPU
     145    {2C115235-8FA9-4F7F-B3A0-A0144F8A35CA}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     146    {2C115235-8FA9-4F7F-B3A0-A0144F8A35CA}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
     147    {D043325A-097F-4512-A8FC-CF706577FA46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     148    {D043325A-097F-4512-A8FC-CF706577FA46}.Debug|Any CPU.Build.0 = Debug|Any CPU
     149    {D043325A-097F-4512-A8FC-CF706577FA46}.Release|Any CPU.ActiveCfg = Release|Any CPU
     150    {D043325A-097F-4512-A8FC-CF706577FA46}.Release|Any CPU.Build.0 = Release|Any CPU
     151    {D043325A-097F-4512-A8FC-CF706577FA46}.ReleaseXBAP|Any CPU.ActiveCfg = Release|Any CPU
     152    {D043325A-097F-4512-A8FC-CF706577FA46}.ReleaseXBAP|Any CPU.Build.0 = Release|Any CPU
     153    {ECD37682-DF7E-409F-912D-0965634556B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     154    {ECD37682-DF7E-409F-912D-0965634556B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
     155    {ECD37682-DF7E-409F-912D-0965634556B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
     156    {ECD37682-DF7E-409F-912D-0965634556B5}.Release|Any CPU.Build.0 = Release|Any CPU
     157    {ECD37682-DF7E-409F-912D-0965634556B5}.ReleaseXBAP|Any CPU.ActiveCfg = ReleaseXBAP|Any CPU
     158    {ECD37682-DF7E-409F-912D-0965634556B5}.ReleaseXBAP|Any CPU.Build.0 = ReleaseXBAP|Any CPU
    120159  EndGlobalSection
    121160  GlobalSection(SolutionProperties) = preSolution
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.Bandits/Policies/UCTPolicy.cs

    r11981 r12503  
    3030          q = double.PositiveInfinity;
    3131        } else {
    32           q = aInfo.SumReward / aInfo.Tries + 2.0 * c * Math.Sqrt(Math.Log(totalTries) / aInfo.Tries);
     32            q = aInfo.SumReward / aInfo.Tries + 2.0 * c * Math.Sqrt(Math.Log(totalTries) / aInfo.Tries);
    3333        }
    3434        if (q > bestQ) {
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.GeneticProgramming/OffspringSelectionGP.cs

    r12023 r12503  
    4646        // osga.Engine = new ParallelEngine.ParallelEngine();
    4747        osga.Engine = new SequentialEngine.SequentialEngine();
    48         osga.ExceptionOccurred += (sender, args) => { Console.WriteLine(args.Value.Message); wh.Set(); };
    49         osga.Stopped += (sender, args) => { wh.Set(); };
     48        //osga.ExceptionOccurred += (sender, args) => { Console.WriteLine(args.Value.Message); wh.Set(); };
     49        //osga.Stopped += (sender, args) => { wh.Set(); };
    5050
    5151        int numEvals = 0;
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/Base/TreeNode.cs

    r12098 r12503  
    1717        public IBanditPolicyActionInfo actionInfo;
    1818
    19         public TreeNode(TreeNode parent, string phrase)
     19        public TreeNode(TreeNode parent, string phrase, IBanditPolicyActionInfo actionInfo)
    2020        {
    2121            this.parent = parent;
    2222            this.phrase = phrase;
    23             actionInfo = new DefaultPolicyActionInfo();
     23            this.actionInfo = actionInfo;
    2424        }
    2525        public bool IsLeaf()
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch.cs

    r12098 r12503  
    5353                string phrase = currentNode.phrase;
    5454
    55                 if (!grammar.IsTerminal(phrase))
     55                if (!grammar.IsTerminal(phrase) && phrase.Length <= maxLen)
    5656                {
    5757                    ExpandTreeNode(currentNode);
     
    6060                        currentNode.children[behaviourPolicy.SelectAction(random, currentNode.GetChildActionInfos())];
    6161                }
    62                 double quality = simulation.Simulate(currentNode);
    63                 OnSolutionEvaluated(phrase, quality);
     62                if (currentNode.phrase.Length <= maxLen)
     63                {
     64                    double quality = simulation.Simulate(currentNode);
     65                    OnSolutionEvaluated(phrase, quality);
    6466
    65                 Propagate(currentNode, quality);
     67                    Propagate(currentNode, quality);
     68                }
    6669            }
    6770        }
     
    8891                            if (newSequence.Length <= maxLen)
    8992                            {
    90                                 TreeNode childNode = new TreeNode(treeNode, newSequence.ToString());
     93                                TreeNode childNode = new TreeNode(treeNode, newSequence.ToString(), behaviourPolicy.CreateActionInfo());
    9194                                treeNode.children.Add(childNode);
    9295                            }
     
    101104            StopRequested = false;
    102105            bestQuality = 0.0;
    103             rootNode = new TreeNode(null, grammar.SentenceSymbol.ToString());
     106            rootNode = new TreeNode(null, grammar.SentenceSymbol.ToString(), behaviourPolicy.CreateActionInfo());
    104107        }
    105108
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/Problems/SantaFeAntProblem.cs

    r12099 r12503  
    5555    }
    5656
    57     private static void Run(Ant ant, string sentence, ref int p, bool stopAfterFirst = false) {
     57      // changed stopAfterFirst to true..
     58    private static void Run(Ant ant, string sentence, ref int p, bool stopAfterFirst = true) {
    5859      while (!ant.Done()) {
    5960        if (p >= sentence.Length) {
  • branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/Sequence.cs

    r11793 r12503  
    1818  // - terminal symbols can be almost all other characters
    1919  public class Sequence : IEnumerable<char> {
    20     private const int maxIdx = 200;
     20      // changed maxIdx to 10000...
     21    private const int maxIdx = 10000;
    2122
    2223    private int len;
  • branches/HeuristicLab.Problems.GrammaticalOptimization/Main/Program.cs

    r12098 r12503  
    3434        private static void RunDemo()
    3535        {
    36 
    37 
    3836            int maxIterations = 100000;
    3937            int iterations = 0;
     
    4644            var problem = new RoyalPairProblem();
    4745            //var problem = new EvenParityProblem();
    48             //var alg = new SequentialSearch(problem, 23, random, 0,
    49             // new HeuristicLab.Algorithms.Bandits.GrammarPolicies.GenericGrammarPolicy(problem, new UCB1TunedPolicy()));
    50             var alg = new MonteCarloTreeSearch(problem, 23, random, new UCB1Policy(), new RandomSimulation(problem, random, 23));
     46            var alg = new SequentialSearch(problem, 23, random, 0,
     47            new HeuristicLab.Algorithms.Bandits.GrammarPolicies.GenericGrammarPolicy(problem, new UCB1TunedPolicy()));
     48            //var alg = new MonteCarloTreeSearch(problem, 23, random, new UCB1Policy(), new RandomSimulation(problem, random, 23));
    5149
    5250
Note: See TracChangeset for help on using the changeset viewer.