Пример #1
0
        private Tile[] CurrentPlayerAttack()
        {
            var states = AttackStateExtractor.ExtractAttackStates(manager, manager.CurrentPlayer).ToList();

            states.ForEach(x => x.Score = attackStateNN.Evaluate(x));
            var chosenState = epsilon > r.Next(1, 101)
                ? states.OrderBy(x => r.NextDouble()).FirstOrDefault()
                : states.Where(x => x.Score > 0.5).OrderByDescending(x => x.Score).FirstOrDefault();

            if (chosenState == null)
            {
                return(null);
            }
            manager.Attack(chosenState.From, chosenState.To);
            manager.CurrentPlayer.AttackStates.Add(chosenState);
            return(new Tile[] { chosenState.From, chosenState.To });
        }
Пример #2
0
        private void btnExtractAndPrint_Click(object sender, EventArgs e)
        {
            var states = AttackStateExtractor.ExtractAttackStates(manager, manager.CurrentPlayer);

            txtStatistics.Text = AttackStateStatistics.GetStatistics(states, attackStateNN);
        }