コード例 #1
0
        public override int Rate()
        {
            if (HeroHp < 1)
            {
                return(Int32.MinValue);
            }

            if (OpHeroHp < 1)
            {
                return(Int32.MaxValue);
            }

            int result = 0;

            Controller player = Controller;
            Controller opp    = player.Opponent;

            int heroHp    = HeroHp + player.Hero.Armor;
            int oppHeroHp = OpHeroHp + opp.Hero.Armor;

            result += (heroHp - oppHeroHp) * 2 * Scale;
            result += player.NumCardsDrawnThisTurn * Scale;
            result += player.NumDiscardedThisGame * -5 * Scale;
            result += player.NumFriendlyMinionsThatAttackedThisTurn * Scale;
            result += player.NumMinionsPlayerKilledThisTurn * Scale;
            result += player.RemainingMana * -Scale;

            Minion[] minions    = BoardZone.GetAll();
            Minion[] oppMinions = OpBoardZone.GetAll();
            result += (minions.Count() - oppMinions.Count()) * 3 * Scale;
            result += getTotalMinionScore(minions);
            result -= getTotalMinionScore(oppMinions);

            return(result);
        }
コード例 #2
0
        public override int Rate()
        {
            if (OpHeroHp < 1)
            {
                return(int.MaxValue);
            }
            if (HeroHp < 1)
            {
                return(int.MinValue);
            }

            float score = 0;

            score += HeroHp - OpHeroHp;
            score += BoardZone.Count() - OpBoardZone.Count();
            score += HeroAtk - OpHeroAtk;

            foreach (Minion Minion in BoardZone)
            {
                score += MinionScore(Minion, true);
            }

            foreach (Minion Minion in OpBoardZone)
            {
                score -= MinionScore(Minion, false);
            }

            return((int)Math.Round(score));
        }
コード例 #3
0
        public override int Rate()
        {
            // Final actions
            if (OpHeroHp < 1)
            {
                return(Int32.MaxValue);
            }
            if (HeroHp < 1)
            {
                return(Int32.MinValue);
            }
            int result = 0;

            result += HeroHp * Values[0];
            result -= OpHeroHp * Values[1];
            result += BoardZone.Count() * Values[2];
            result -= OpBoardZone.Count() * Values[3];
            result += MinionTotAtk * Values[4];
            result -= OpMinionTotAtk * Values[5];
            result += MinionTotHealth * Values[6];
            result -= OpMinionTotHealth * Values[7];
            result += MinionTotHealthTaunt * Values[8];
            result -= OpMinionTotHealthTaunt * Values[9];

            return(result);
        }
コード例 #4
0
        public override int Rate()
        {
            // lose
            if (HeroHp < 1)
            {
                return(Int32.MinValue);
            }
            // win
            if (OpHeroHp < 1)
            {
                return(Int32.MaxValue);
            }

            int result = 0;
            int scale  = 1000;

            //if (OpBoardZone.Count == 0 && BoardZone.Count > 0)
            //	result += 1000;

            //if (OpMinionTotHealthTaunt > 0)
            //	result += OpMinionTotHealthTaunt * -1000;

            //result += MinionTotAtk;

            Controller player = Controller;
            Controller opp    = player.Opponent;

            int heroHp    = HeroHp + player.Hero.Armor;
            int oppHeroHp = OpHeroHp + opp.Hero.Armor;

            //result += (HeroHp - OpHeroHp) * 1000;
            //result += (heroHp - oppHeroHp);
            result += (heroHp - oppHeroHp) * scale;

            result += HandCnt * 3 * scale;
            result -= OpHandCnt * 3 * scale;

            Minion[] minions = BoardZone.GetAll();
            result += minions.Count() * 2 * scale;
            foreach (Minion minion in minions)
            {
                result += getMinionScore(minion) * scale;
            }

            Minion[] oppMinions = OpBoardZone.GetAll();
            result -= oppMinions.Count() * 2 * scale;
            foreach (Minion oppMinion in oppMinions)
            {
                result -= getMinionScore(oppMinion) * scale;
            }

            return(result);
        }
コード例 #5
0
        //private int MinionHealthDiffReward = 1000;
        //private int MinionAttDiffReward = 1000;
        //private int OpNoBoardReward = 5000;
        //private int HeroAttackDifReward = 1000;

        //45 with bot5
        public override int MyRate()
        {
            Controller player   = Controller;
            Controller opponent = player.Opponent;

            if (OpHp < 1)
            {
                return(Int32.MaxValue);
            }
            if (MyHp < 1)
            {
                return(Int32.MinValue);
            }


            int result = 0;


            result += MyHp * HealthReward;
            result -= OpHp * OppHealthReward;

            result += player.NumCardsDrawnThisTurn * DrawCountReward;
            result -= player.NumDiscardedThisGame * DiscartedCountReward;

            //result += MyBoardZone.Count * MyBoardCountReward ;
            //result += OpBoardZone.Count * OpBoardCountReward;

            Minion[] myMinions  = player.BoardZone.GetAll();
            Minion[] oppMinions = OpBoardZone.GetAll();

            result += (myMinions.Count() - oppMinions.Count()) * MyMinionScoreReward;

            foreach (Minion minion in myMinions)
            {
                result += getMinionScore(minion) * MyMinionScoreReward;
            }
            foreach (Minion minion in oppMinions)
            {
                result -= getMinionScore(minion) * OppMinionScoreReward;
            }



            result += player.NumMinionsPlayerKilledThisTurn * MinionsKillCountReward;

            if (player.HeroClass == CardClass.SHAMAN || player.HeroClass == CardClass.ROGUE || player.HeroClass == CardClass.DRUID)
            {
                result += player.JadeGolem * JadeScaleReward;
            }

            return(result);
        }
        public override int Rate()
        {
            if (HeroHp < 1)
            {
                return(Int32.MinValue);
            }

            if (OpHeroHp < 1)
            {
                return(Int32.MaxValue);
            }

            int result = 0;

            if (OpBoardZone.Count == 0 && BoardZone.Count > 0)
            {
                result += 7 * Scale;
            }

            Controller player = Controller;
            Controller opp    = player.Opponent;

            result += player.AmountHeroHealedThisTurn * 5;
            result -= opp.AmountHeroHealedThisTurn * 5;
            result += player.JadeGolem * 10 * Scale;
            result += player.NumCardsDrawnThisTurn * Scale;
            result += player.NumDiscardedThisGame * -5 * Scale;
            result += player.NumFriendlyMinionsThatAttackedThisTurn * Scale;
            result += player.NumMinionsPlayerKilledThisTurn * Scale;
            result += player.RemainingMana * -Scale;

            int heroHp    = HeroHp + player.Hero.Armor;
            int oppHeroHp = OpHeroHp + opp.Hero.Armor;

            result += (heroHp - oppHeroHp) * Scale;
            result += HandCnt * 2 * Scale;
            result -= OpHandCnt * 2 * Scale;

            Minion[] minions    = BoardZone.GetAll();
            Minion[] oppMinions = OpBoardZone.GetAll();

            result += (minions.Count() - oppMinions.Count()) * 4 * Scale;
            result += getTotalMinionScore(minions);
            result -= getTotalMinionScore(oppMinions);

            if (OpMinionTotHealthTaunt > 0)
            {
                result += OpMinionTotHealthTaunt * -Scale;
            }

            return(result);
        }
コード例 #7
0
        public override int Rate()
        {
            // lose
            if (HeroHp < 1)
            {
                return(Int32.MinValue);
            }
            // win
            if (OpHeroHp < 1)
            {
                return(Int32.MaxValue);
            }

            int result = 0;
            int scale  = 1000;

            Controller player = Controller;
            Controller opp    = player.Opponent;

            int heroHp    = HeroHp + player.Hero.Armor;
            int oppHeroHp = OpHeroHp + opp.Hero.Armor;

            // ReSharper disable once UselessBinaryOperation
            result = (heroHp - oppHeroHp) * scale + result;

            result += HandCnt * 3 * scale;
            result -= OpHandCnt * 3 * scale;

            Minion[] minions = BoardZone.GetAll();
            result += minions.Count() * 2 * scale;
            foreach (Minion minion in minions)
            {
                result += getMinionScore(minion) * scale;
            }

            Minion[] oppMinions = OpBoardZone.GetAll();
            result -= oppMinions.Count() * 2 * scale;
            foreach (Minion oppMinion in oppMinions)
            {
                result -= getMinionScore(oppMinion) * scale;
            }

            return(result);
        }
コード例 #8
0
        public override int Rate()
        {
            if (HeroHp < 1)
            {
                return(Int32.MinValue);
            }

            if (OpHeroHp < 1)
            {
                return(Int32.MaxValue);
            }

            int result = 0;
            int scale  = 1000;

            Controller player = Controller;
            Controller opp    = player.Opponent;

            int heroHp    = HeroHp + player.Hero.Armor;
            int oppHeroHp = OpHeroHp + opp.Hero.Armor;

            result += (heroHp - oppHeroHp) * scale;

            result += HandCnt * 3 * scale;
            result -= OpHandCnt * 3 * scale;

            Minion[] minions = BoardZone.GetAll();
            result += minions.Count() * 2 * scale;
            foreach (Minion minion in minions)
            {
                result += MinionScore(minion) * scale;
            }

            Minion[] oppMinions = OpBoardZone.GetAll();
            result -= oppMinions.Count() * 2 * scale;
            foreach (Minion oppMinion in oppMinions)
            {
                result -= MinionScore(oppMinion) * scale;
            }

            return(result);
        }
コード例 #9
0
        public override int Rate()
        {
            if (OpHeroHp < 1)
            {
                return(Int32.MaxValue);
            }

            if (HeroHp < 1)
            {
                return(Int32.MinValue);
            }

            int result = 0;
            int index  = Turn;

            if (index > 9)
            {
                index = 9;
            }

            result += BoardCoef[index, RemainingManaCoef] * RemainingMana;
            result += BoardCoef[index, UsedManaCoef] * UsedMana;
            result += BoardCoef[index, ArmerCoef] * Armer;
            result += BoardCoef[index, OpArmerCoef] * OpArmer;
            result += BoardCoef[index, BoardZoneCntCoef] * BoardZoneCnt;
            result += BoardCoef[index, OpBoardZoneCntCoef] * OpBoardZoneCnt;
            result += BoardCoef[index, HeroHpCoef] * HeroHp;
            result += BoardCoef[index, OpHeroHpCoef] * OpHeroHp;
            result += BoardCoef[index, HeroAtkCoef] * HeroAtk;
            result += BoardCoef[index, OpHeroAtkCoef] * OpHeroAtk;
            result += BoardCoef[index, HandTotCostCoef] * HandTotCost;
            result += BoardCoef[index, HandCntCoef] * HandCnt;
            result += BoardCoef[index, OpHandCntCoef] * OpHandCnt;
            result += BoardCoef[index, DeckCntCoef] * DeckCnt;
            result += BoardCoef[index, OpDeckCntCoef] * OpDeckCnt;
            result += BoardCoef[index, MinionTotAtkCoef] * MinionTotAtk;
            result += BoardCoef[index, OpMinionTotAtkCoef] * OpMinionTotAtk;
            result += BoardCoef[index, MinionTotHealthCoef] * MinionTotHealth;
            result += BoardCoef[index, OpMinionTotHealthCoef] * OpMinionTotHealth;
            result += BoardCoef[index, MinionTotHealthTauntCoef] * MinionTotHealthTaunt;
            result += BoardCoef[index, OpMinionTotHealthTauntCoef] * OpMinionTotHealthTaunt;

            foreach (Minion m in BoardZone.GetAll())
            {
                if (m != null)
                {
                    int cost = m.Cost;
                    if (cost > 10)
                    {
                        cost = 10;
                    }
                    result += MinionsCoef[cost];
                }
            }

            foreach (Minion m in OpBoardZone.GetAll())
            {
                if (m != null)
                {
                    int cost = m.Cost;
                    if (cost > 10)
                    {
                        cost = 10;
                    }
                    result += OpMinionsCoef[cost];
                }
            }

            return(result);
        }
コード例 #10
0
        public double[] GetFeatureVector()
        {
            var features = new double[FACTORS];

            features[0] = (HeroHp);
            features[1] = (OpHeroHp);
            features[2] = (HeroAtk);
            features[3] = (OpHeroAtk);
            features[4] = (HandTotCost);
            features[5] = (HandCnt);
            features[6] = (OpHandCnt);
            features[7] = (DeckCnt);
            features[8] = (OpDeckCnt);

            features[9]  = (MinionTotAtk);
            features[10] = (OpMinionTotAtk);
            features[11] = (MinionTotHealth);
            features[12] = (OpMinionTotHealth);
            features[13] = (MinionTotHealthTaunt);
            features[14] = (OpMinionTotHealthTaunt);

            features[15] = (Hand.Sum(x => x.IsExhausted ? 1 : 0));
            features[16] = (Hand.Sum(x => x.Overload));
            features[17] = (Hand.Sum(x => x.HasDeathrattle? 1 : 0));
            features[18] = (Hand.Sum(x => x.HasLifeSteal ? 1 : 0));
            features[19] = (Hand.Sum(x => x.IsEcho ? 1 : 0));
            features[20] = (Hand.Sum(x => x.HasOverkill ? 1 : 0));
            features[21] = (Hand.Sum(x => x.Cost));

            features[22] = (BoardZone.Sum(x => x.SpellPower));
            features[23] = (BoardZone.Sum(x => x.HasCharge ? 1 : 0));
            features[24] = (BoardZone.Sum(x => x.HasDivineShield ? 1 : 0));
            features[25] = (BoardZone.Sum(x => x.HasWindfury ? 1 : 0));
            features[26] = (BoardZone.Sum(x => x.HasBattleCry ? 1 : 0));
            features[27] = (BoardZone.Sum(x => x.HasDeathrattle ? 1 : 0));
            features[28] = (BoardZone.Sum(x => x.HasInspire ? 1 : 0));
            features[29] = (BoardZone.Sum(x => x.IsEnraged ? 1 : 0));
            features[30] = (BoardZone.Sum(x => x.Freeze ? 1 : 0));
            features[31] = (BoardZone.Sum(x => x.Poisonous ? 1 : 0));
            features[32] = (BoardZone.Sum(x => x.HasLifeSteal ? 1 : 0));
            features[33] = (BoardZone.Sum(x => x.Untouchable ? 1 : 0));
            features[34] = (BoardZone.Sum(x => x.IsRush ? 1 : 0));
            features[35] = (BoardZone.Sum(x => x.AttackableByRush ? 1 : 0));

            features[36] = (OpBoardZone.Sum(x => x.SpellPower));
            features[37] = (OpBoardZone.Sum(x => x.HasCharge ? 1 : 0));
            features[38] = (OpBoardZone.Sum(x => x.HasDivineShield ? 1 : 0));
            features[39] = (OpBoardZone.Sum(x => x.HasWindfury ? 1 : 0));
            features[40] = (OpBoardZone.Sum(x => x.HasBattleCry ? 1 : 0));
            features[41] = (OpBoardZone.Sum(x => x.HasDeathrattle ? 1 : 0));
            features[42] = (OpBoardZone.Sum(x => x.HasInspire ? 1 : 0));
            features[43] = (OpBoardZone.Sum(x => x.IsEnraged ? 1 : 0));
            features[44] = (OpBoardZone.Sum(x => x.Freeze ? 1 : 0));
            features[45] = (OpBoardZone.Sum(x => x.Poisonous ? 1 : 0));
            features[46] = (OpBoardZone.Sum(x => x.HasLifeSteal ? 1 : 0));
            features[47] = (OpBoardZone.Sum(x => x.Untouchable ? 1 : 0));
            features[48] = (OpBoardZone.Sum(x => x.IsRush ? 1 : 0));
            features[49] = (OpBoardZone.Sum(x => x.AttackableByRush ? 1 : 0));

            return(features);
        }