Beispiel #1
0
        public CommandLineInitializer(string graphText)
        {
            factory = new AgentsFactory();
            InitializeConstants();
            var graph  = CreateGraph(graphText);
            var agents = CreateAgents(graph);

            InitialState = new State(graph, agents);
        }
Beispiel #2
0
 protected override InvestAgent getFallBackAgent()
 {
     if (_fallBackAgent == null)
     {
         AgentsFactory factory = new AgentsFactory();
         _fallBackAgent = factory.CreateAgent(ConfigurationManager.AppSettings["RegressionFallBackAgent"], _gm, _comm, _isTrain);
     }
     return(_fallBackAgent);
 }
Beispiel #3
0
        public static void Exp_3__RandomGames__p_RHE_Agent()
        {
            Random randomness_provider = new Random();

            // testbed - settings...
            int number_of_games_to_generate = 10;
            int number_of_players           = 4;
            int game_difficulty             = 0; // easy

            // generate the random games (test-bed)
            List <PD_Game> games = Generate_Random_Games(
                randomness_provider,
                number_of_games_to_generate,
                number_of_players,
                game_difficulty
                );

            // experiment - settings
            int  number_of_repetitions_per_game = 10;
            bool save_initial_game_states       = true;
            bool keep_game_stats_report         = true;
            bool keep_trace = false;

            // debugging settings
            bool display_actions   = true;
            bool display_end_state = true;

            // initialize the pathFinder
            PD_AI_PathFinder pathFinder = new PD_AI_PathFinder();

            // define the agent and the dictionary for the experiment runner
            var p_RHE_agent = AgentsFactory.P_RHE_Agent(pathFinder);
            Dictionary <PD_AI_Agent_Base, string> agentsDictionary = new Dictionary <PD_AI_Agent_Base, string>()
            {
                { p_RHE_agent, "p_RHE" }
            };

            // prepare the experiment results directory
            string experimentResults_Directory = Directory.GetCurrentDirectory() + "\\ExperimentResults";

            if (PD_IO_Utilities.FolderExists(experimentResults_Directory) == false)
            {
                PD_IO_Utilities.CreateFolder(experimentResults_Directory, true);
            }

            Pandemic_Experiment experiment = new Pandemic_Experiment(
                games,
                save_initial_game_states,
                agentsDictionary,
                pathFinder,
                number_of_repetitions_per_game,
                experimentResults_Directory,
                keep_game_stats_report,
                keep_trace
                );

            experiment.RunExperiment(
                randomness_provider,
                pathFinder,
                display_actions,
                display_end_state
                );
        }