예제 #1
0
        public void Execute()
        {
            // Create new lists of bots, each with new instances of each bot, for each distinct seating order
            var playerList          = BotHelper.GetGameBots().Select(i => i.Player).ToList();
            var seatingCombinations = Enumerable.Range(0, 4).Permute().Select(i => this.GetBots(i, playerList)).ToArray();

            // Execute a simulation for every seating combination
            new Launcher().ExecuteSimulations(seatingCombinations);
        }
예제 #2
0
        private List <Bot> GetBots(IEnumerable <int> indicies, List <Player> players)
        {
            // Due to the coupling of Player and Agent we need to be careful in ensuring the player instances remain the same, and only bot instances are recreated
            var indiciesList = indicies.ToList();
            var agents       = BotHelper.GetGameBots().ToList();

            return(new List <Bot>
            {
                agents[indiciesList[0]].Clone(players[indiciesList[0]]),
                agents[indiciesList[1]].Clone(players[indiciesList[1]]),
                agents[indiciesList[2]].Clone(players[indiciesList[2]]),
                agents[indiciesList[3]].Clone(players[indiciesList[3]]),
            });
        }
예제 #3
0
 public void Execute()
 {
     new Launcher()
     .ExecuteSimulations(new[] { BotHelper.GetGameBots() });
 }