ComparePlayers() public method

public ComparePlayers ( PlayerAction playerActions, GameConfig gameConfig, bool rotateWhoStartsFirst = true, bool shouldParallel = true, bool showVerboseScore = true, bool showCompactScore = false, bool showDistribution = false, bool createHtmlReport = true, bool createRankingReport = false, int numberOfGames = 1000, int logGameCount = 100, bool debugLogs = false, CreateGameLog createGameLog = null ) : double
playerActions PlayerAction
gameConfig GameConfig
rotateWhoStartsFirst bool
shouldParallel bool
showVerboseScore bool
showCompactScore bool
showDistribution bool
createHtmlReport bool
createRankingReport bool
numberOfGames int
logGameCount int
debugLogs bool
createGameLog CreateGameLog
return double
 public static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=7476.msg212934#msg212934
     testOutput.ComparePlayers("DuchyDukeWarehouseEmbassy", "BigMoney");
     testOutput.ComparePlayers("FeodumDevelop", "BigMoney");
     testOutput.ComparePlayers("DuchyDukeWarehouseEmbassy", "FeodumDevelop");
 }
 static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=6281.0
     testOutput.ComparePlayers("Rebuild", "BigMoney");
     //testOutput.ComparePlayers(Strategies.BigMoneyWithCard<CardTypes.Catacombs>.Player(1, 2), Strategies.BigMoney.Player(2));
     //testOutput.ComparePlayers(Strategies.BigMoneyWithCard<CardTypes.Count>.Player(1), Strategies.BigMoney.Player(2));
     testOutput.ComparePlayers(Strategies.BigMoneyWithCard.Player(Cards.HuntingGrounds), Strategies.BigMoney.Player());
 }
 public static void Run(TestOutput testOutput)
 {
     var rebuildStrategy = Strategies.Rebuild.Player();
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=8391.0
     testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoney.Player());
     testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.Wharf, cardCount: 2));
     testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.Mountebank, cardCount: 2));
     testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2));
     testOutput.ComparePlayers(rebuildStrategy, Strategies.BigMoneyWithCard.Player(Cards.YoungWitch, cardCount: 2));
 }
        private static void ComparePlayers(int gameCount, CardCountPair[] startingCards, TestOutput testOutput)
        {
            var gameLogFactory = new GameLogFactory();

            var player1 = Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2);
            var player2 = Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2);

            var builder = new GameConfigBuilder();
            builder.SetKingdomCards(player1, player2);
            if (startingCards != null)
                builder.SetStartingDeck(startingCards);

            var gameConfig = builder.ToGameConfig();

            testOutput.ComparePlayers(
                Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2),
                Strategies.BigMoneyWithCard.Player(Cards.Witch, cardCount: 2),
                gameConfig,
                rotateWhoStartsFirst: true,
                numberOfGames: gameCount,
                createGameLog: new Dominion.Data.CreateGameLog(gameLogFactory.CreateGameLog));

            System.Console.WriteLine("Curses Split was Uneven {0}%", gameLogFactory.UnEvenSplitPercent);
            System.Console.WriteLine();
            System.Console.WriteLine("When the curses were not split, Player 1 won the curse split {0}/{1}", gameLogFactory.Player1WinPercent, gameLogFactory.Player2WinPercent);
        }
 static void Run(TestOutput testOutput)
 {
     // goal is to find a strategy that always beats big money.  Haven't found it yet.
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=8580.0
     //ComparePlayers(Strategies.FishingVillageChapelPoorHouseTalisman.Player(1), Strategies.BigMoney.Player(2));
     //ComparePlayers(Strategies.FishingVillageChapelPoorHouse.Player(1), Strategies.BigMoney.Player(2));
     testOutput.ComparePlayers("GardensBeggarIronworks", "BigMoney", numberOfGames: 10000);
 }
 static void EvaulateBestStrategyForFirstGame(TestOutput testOutput)
 {
     //FindBestStrategy currently finds the following, which is better than BigMoneySimple, but not as good as BigMoney
     //Province(1), Province, Gold, Market(1), Duchy(2), Militia(2), Silver, Estate(1),Workshop(1), Cellar(1),
     var player1 = new PlayerAction("Player 1",
         new CardPickByPriority(
             CardAcceptance.For(Cards.Province),
             CardAcceptance.For(Cards.Gold),
             CardAcceptance.For(Cards.Market, gameState => Strategy.CountAllOwned(Cards.Market, gameState) < 1),
             CardAcceptance.For(Cards.Duchy, gameState => Strategy.CountAllOwned(Cards.Duchy, gameState) < 2),
             CardAcceptance.For(Cards.Militia, gameState => Strategy.CountAllOwned(Cards.Militia, gameState) < 2),
             CardAcceptance.For(Cards.Silver),
             CardAcceptance.For(Cards.Estate, gameState => Strategy.CountAllOwned(Cards.Militia, gameState) < 1)
             ));
     testOutput.ComparePlayers(player1, Strategies.BigMoneySimple.Player(), showVerboseScore: true);
     testOutput.ComparePlayers(player1, Strategies.BigMoney.Player(), showVerboseScore: true);
     testOutput.ComparePlayers(player1, Strategies.BigMoneySingleSmithy.Player(), showVerboseScore: true);
 }
 public static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=6623.0
     System.Console.WriteLine("Followers Cost, Player 1 Win %, Player 2 Win%, Tie%");
     for (int i = 0; i < 16; ++i)
     {
         System.Console.Write("{0}, ", i);
         testOutput.ComparePlayers(Strategies.FollowersTest.TestPlayer(i), Strategies.BigMoney.Player(), showCompactScore: true);
     }
 }
Beispiel #8
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);
                }
            }
        }
Beispiel #9
0
 static void Main(string[] args)
 {
     using (var testOutput = new TestOutput())
     {
         var bigMoneyPlayer = Strategies.BigMoneyWithCard.Player(Cards.Magpie, playerName:"single magpie");
         foreach (PlayerAction playerAction in AllBigMoneyWithCard())
         {
             testOutput.ComparePlayers(bigMoneyPlayer, playerAction, numberOfGames: 1000, shouldParallel: true, createHtmlReport: false, createRankingReport: true, logGameCount: 0);
         }
     }
 }
        public static void Run(TestOutput testOutput)
        {
            GameConfig gameConfig = GameConfigBuilder.Create(
                StartingCardSplit.Split43,
                Cards.Bishop,
                Cards.FarmingVillage,
                Cards.GrandMarket,
                Cards.Hamlet,
                Cards.Hoard,
                Cards.Monument,
                Cards.Mountebank,
                Cards.PhilosophersStone,
                Cards.ScryingPool,
                Cards.Vineyard
                );

            testOutput.ComparePlayers(Strategies.MountebankMonumentHamletVineyard.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.MountebankHoard.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.MountebankMonumentHamletVineyard.Player(), Strategies.MountebankHoard.Player(), gameConfig);
        }
        // forum post:  http://forum.dominionstrategy.com/index.php?topic=9602.0
        /*  any attempt to get more than one remake, or more than 2 sooth sayers results in a loss ....  (but in real game, the plan was 3 remakes and 3 soothsayers ...)
         *
         *
         * */
        public static void Run(TestOutput testOutput)
        {
            GameConfig gameConfig = GameConfigBuilder.Create(
                StartingCardSplit.Split43,
                Cards.Butcher,
                Cards.GreatHall,
                Cards.HornOfPlenty,
                Cards.HorseTraders,
                Cards.Minion,
                Cards.Pawn,
                Cards.Remake,
                Cards.Soothsayer,
                Cards.StoneMason,
                Cards.Swindler
                );

            //testOutput.ComparePlayers(Strategies.HorseTraderSoothsayerMinionGreatHall.Player(1), Strategies.HorseTraderSoothsayerMinionGreatHall.Player(2, false), gameConfig);
            testOutput.ComparePlayers(Strategies.HorseTraderSoothsayerMinionGreatHall.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.RemakeSoothsayer.Player(), Strategies.BigMoney.Player(), gameConfig);
            testOutput.ComparePlayers(Strategies.RemakeSoothsayer.Player(), Strategies.HorseTraderSoothsayerMinionGreatHall.Player(), gameConfig);
        }
        public static void Run(TestOutput testOutput)
        {
            testOutput.ComparePlayers(Strategies.BigMoney.Player(), Strategies.BigMoneyFishingVillageOverSilver.Player(2));
            testOutput.ComparePlayers(Strategies.BigMoney.Player(), Strategies.BigMoneyFishingVillageAvailableForDeckCycle.Player(2));
            testOutput.ComparePlayers(Strategies.BigMoney.Player(), Strategies.BigMoneyFishingVillageEmptyDuration.Player(2));
            testOutput.ComparePlayers(Strategies.BigMoneyFishingVillageAvailableForDeckCycle.Player(1), Strategies.BigMoneyFishingVillageEmptyDuration.Player(2));

            testOutput.ComparePlayers(Strategies.BigMoneyDoubleJack.Player(), Strategies.BigMoney.Player());
            testOutput.ComparePlayers(Strategies.BigMoneyWithSilverReplacement.Player(Cards.FishingVillage, "BigMoneyWithFishingDoubleJack", Cards.JackOfAllTrades, count: 2), Strategies.BigMoney.Player());
            testOutput.ComparePlayers(Strategies.BigMoneyDoubleJack.Player(), Strategies.BigMoneyWithSilverReplacement.Player(Cards.FishingVillage, "BigMoneyWithFishingDoubleJack", Cards.JackOfAllTrades, count: 2));
        }
Beispiel #13
0
        static void Main()
        {
            using (var testOutput = new TestOutput())
            {
                var player1 = Strategies.BigMoney.Player();
                var player2 = Strategies.Miser.Player();

                var builder = new GameConfigBuilder();
                builder.CardSplit = StartingCardSplit.Split43;
                builder.SetKingdomCards(player1, player2);

                testOutput.ComparePlayers(
                    new PlayerAction[] { player1, player2},
                    builder.ToGameConfig(),
                    rotateWhoStartsFirst:true,
                    createHtmlReport: true,
                    numberOfGames: 1000,
                    shouldParallel: false);
            }
        }
Beispiel #14
0
        static void Main(string[] args)
        {
            using (var testOutput = new TestOutput())
            {
                var playerAction = Strategies.BigMoneyWithCard.Player(Cards.Magpie, cardCount:2, playerName: "DoubleMagpie");
                foreach (PlayerAction otherPlayerAction in BuiltInStrategies.StrategyLoader.GetAllPlayerActions())
                {
                    if (playerAction == otherPlayerAction)
                        continue;

                    testOutput.ComparePlayers(
                        playerAction,
                        otherPlayerAction,
                        shouldParallel: true,
                        logGameCount: 0,
                        debugLogs: false,
                        numberOfGames: 1000,
                        useColonyAndPlatinum: true,
                        createHtmlReport: false,
                        createRankingReport: true);
                }
            }
        }
 public static void Run(TestOutput testOutput)
 {
     testOutput.ComparePlayers("RebuildAdvanced", "RebuildAdvanced", startingDeckPerPlayer: StartingDecksForRebuildWithEstateAdvantage.StartingDecks);
 }
 public static void Run(TestOutput testOutput)
 {
     // for forum topic: http://forum.dominionstrategy.com/index.php?topic=8461.0
     testOutput.ComparePlayers(Strategies.BigMoneyWithCard.Player(Cards.Soothsayer), Strategies.BigMoneyWithCard.Player(Cards.Witch));
 }