Beispiel #1
0
        static void FindOptimalPlayForEachCardWithBigMoney()
        {
            var bigMoneyPlayer = "BigMoney";

            foreach (var member in typeof(Cards).GetMembers(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public))
            {
                if (member.MemberType == System.Reflection.MemberTypes.Field)
                {
                    Card card = (Card)(typeof(Cards).GetField(member.Name).GetValue(null));
                    if (!GameConfigBuilder.IsKingdomCard(card))
                    {
                        continue;
                    }

                    if (notImplementedCards.Contains(card))
                    {
                        continue;
                    }

                    var playerAction = StrategyOptimizer.FindBestBigMoneyWithCardVsStrategy("BigMoney", card); // Strategies.BigMoneyWithCard.Player(card, "BigMoney<" + card.name + ">");

                    ComparePlayers(playerAction, bigMoneyPlayer, numberOfGames: 1000, shouldParallel: true, createHtmlReport: true, logGameCount: 0);
                }
            }
        }
Beispiel #2
0
        static void FindOptimalPlayForEachCardWithBigMoney()
        {
            PlayerAction bigMoneyPlayer = Strategies.BigMoney.Player();

            using (var htmlRender = new HtmlRenderer.DeferredHtmlGenerator())
                using (var testoutput = new TestOutput())
                {
                    foreach (Card card in Dominion.Strategy.MissingDefaults.FullyImplementedKingdomCards())
                    {
                        var playerAction = StrategyOptimizer.FindBestBigMoneyWithCardVsStrategy(bigMoneyPlayer, card, logProgress: false);
                        var results      = Dominion.Data.StrategyComparison.Compare(playerAction, bigMoneyPlayer, shouldParalell: true);
                        htmlRender.AddResults(results, TestOutput.GetOutputFilename);

                        System.Console.WriteLine("Before Optimization");
                        testoutput.ComparePlayers(Strategies.BigMoneyWithCard.Player(card), bigMoneyPlayer, createHtmlReport: false);
                        System.Console.WriteLine("After Optimization");
                        testoutput.ComparePlayers(playerAction, bigMoneyPlayer, createHtmlReport: false);
                    }
                }
        }
 static void Run()
 {
     StrategyOptimizer.FindBestStrategyForGame(GameSets.FirstGame);
 }