示例#1
0
        public FightingBot()
        {
            roundCounter = new RoundCounter();

            attackHistory = new Dictionary <Area, OptimalizationAwareMove>
            {
                { Area.HookKick, new OptimalizationAwareMove(MoveType.Attack, Area.HookKick,
                                                             Config.AttacksBaseValues[Area.HookKick], roundCounter) },
                { Area.HookPunch, new OptimalizationAwareMove(MoveType.Attack, Area.HookPunch,
                                                              Config.AttacksBaseValues[Area.HookPunch], roundCounter) },
                { Area.LowKick, new OptimalizationAwareMove(MoveType.Attack, Area.LowKick,
                                                            Config.AttacksBaseValues[Area.LowKick], roundCounter) },
                { Area.UppercutPunch, new OptimalizationAwareMove(MoveType.Attack, Area.UppercutPunch,
                                                                  Config.AttacksBaseValues[Area.UppercutPunch], roundCounter) },
            };

            defenseHistory = new Dictionary <Area, OptimalizationAwareMove>
            {
                { Area.HookKick, new OptimalizationAwareMove(MoveType.Defense, Area.HookKick,
                                                             Config.DefensesBaseValues[Area.HookKick], roundCounter) },
                { Area.HookPunch, new OptimalizationAwareMove(MoveType.Defense, Area.HookPunch,
                                                              Config.DefensesBaseValues[Area.HookPunch], roundCounter) },
                { Area.LowKick, new OptimalizationAwareMove(MoveType.Defense, Area.LowKick,
                                                            Config.DefensesBaseValues[Area.LowKick], roundCounter) },
                { Area.UppercutPunch, new OptimalizationAwareMove(MoveType.Defense, Area.UppercutPunch,
                                                                  Config.DefensesBaseValues[Area.UppercutPunch], roundCounter) },
            };

            solver = new DynamicKanpsnackSolver <OptimalizationAwareMove>();
        }
示例#2
0
        public OptimalizationAwareMove(MoveType type, Area area, double baseValue, RoundCounter globalRoundCounter, int maxAttackTypeRepetitions = 2)
            : base(type, area)
        {
            this.baseValue = baseValue;

            if (type == MoveType.Attack)
            {
                // You can repeat one attack
                // as may times as you wish
                Quantity = maxAttackTypeRepetitions;
            }
            else
            {
                // You should not repeat defences
                Quantity = 1;
            }

            this.roundCounter = globalRoundCounter;
        }