Exemple #1
0
        protected override void Turn(int turn, Action <Intent> agent1, Action <Intent> agent2)
        {
            int w = Field.Width - 1;
            int h = Field.Height - 1;

            if (Way == null)
            {
                Way = new Helper.Way(Team.Agent1.Position, new Point(w, h), new Point(0, h), new Point(0, 0), new Point(w, 0));
            }

            Way.Next(out var _, out var d);
            agent1(new Intent()
            {
                Intention = Intentions.Move,
                Direction = d
            });
            agent2(Intent.StayIntent);
        }
        protected override ScoringEfficiency EvaluateGame()
        {
            if (RegionResult == null)
            {
                RegionResult = Search(Agent.Position, Math.Min(Around, Game.Length - Game.Turn + 1));
                Dumper?.Dump();
                Dumper?.Reset();

                if (RegionResult.Ends.Count > 0)
                {
                    Way = new Helper.Way(Agent, RegionResult.Ends.First().Went.ToArray());
                }
                else
                {
                    Console.WriteLine("近傍領域探索:領域を生成できませんでした");
                    return(null);
                }
            }

            return(RegionResult.Ends.FirstOrDefault()?.GetScoringEfficiency());
        }