private void ComputeFitness(TyWeightsLearner learner, List <TyDeckHeroPair> myDeck, List <TyDeckHeroPair> enemyDeck, AbstractAgent enemyAgent)
        {
            learner.BeforeLearn();

            TyMatchSetup training = new TyMatchSetup(TycheAgent.GetLearningAgent(learner.Weights), enemyAgent);

            training.RunRounds(myDeck, enemyDeck, Rounds, MatchesPerRound);

            learner.AfterLearn(training.TotalPlays, training.Agent0Wins);
        }
Beispiel #2
0
        private static void AllMirroredDecksAllAgents()
        {
            const int ROUNDS            = 100;
            const int MATCHES_PER_ROUND = 1;

            TyDebug.LogInfo("Debug Test");
            TyDebug.LogInfo("Total matches: " + (ROUNDS * MATCHES_PER_ROUND));

            List <List <TyDeckHeroPair> > decks = new List <List <TyDeckHeroPair> >
            {
                DeckFromEnum(DeckFu.Druid),
                DeckFromEnum(DeckFu.Mage),
                DeckFromEnum(DeckFu.Paladin),
                DeckFromEnum(DeckFu.Priest),
                DeckFromEnum(DeckFu.Rogue),
                DeckFromEnum(DeckFu.Shaman),
                DeckFromEnum(DeckFu.Warlock),
                DeckFromEnum(DeckFu.Warrior)
            };


            //for (int i = 0; i < _allEnemyAgents.Count; i++)
            {
                for (int j = 0; j < decks.Count; j++)
                {
                    var deck = decks[j];
                    TyDebug.LogInfo(deck[0].Name);


                    for (int l = 0; l < 4; l++)
                    {
                        var myAgent    = new TycheAgent();
                        var enemyAgent = TycheAgent.GetTrainingAgent();                         //_allEnemyAgents[i % _allEnemyAgents.Count];

                        TyMatchSetup training = new TyMatchSetup(myAgent, enemyAgent);
                        training.RunRounds(deck, deck, ROUNDS, MATCHES_PER_ROUND);
                        training.PrintFinalResults();
                    }
                }
            }

            TyDebug.LogInfo("Press a key to close.");
            Console.ReadLine();
        }
Beispiel #3
0
        private static void QuickTest()
        {
            const int ROUNDS            = 40;
            const int MATCHES_PER_ROUND = 1;

            TyDebug.LogInfo("Quick Test Setup");
            TyDebug.LogInfo("Total matches to play: " + (ROUNDS * MATCHES_PER_ROUND));

            List <List <TyDeckHeroPair> > decks = new List <List <TyDeckHeroPair> >
            {
                DeckFromEnum(DeckFu.Shaman)

                /*
                 * DeckFromEnum(DeckFu.Warrior),
                 * DeckFromEnum(DeckFu.Druid),
                 * DeckFromEnum(DeckFu.Warlock),
                 * DeckFromEnum(DeckFu.Paladin),
                 * DeckFromEnum(DeckFu.Rogue),
                 * DeckFromEnum(DeckFu.Priest),
                 * DeckFromEnum(DeckFu.Mage),
                 */
            };

            for (int j = 0; j < decks.Count; j++)
            {
                var myAgent    = TycheAgent.GetSearchTreeAgent(20);
                var enemyAgent = TycheAgent.GetTrainingAgent(0.0f, false);

                TyMatchSetup training = new TyMatchSetup(myAgent, enemyAgent);
                //training.PrintMatchTimes = true;
                training.RunRounds(decks[j], decks[j], ROUNDS, MATCHES_PER_ROUND);
                training.PrintFinalResults();
            }

            TyDebug.LogInfo("Press a key to close.");
            Console.ReadLine();
        }