Exemple #1
0
        public void Game()
        {
            #region Initialization

            timer.AddReferee(kref);
            config = KPExperimentConfig.Load("KPExperimentConfig.xml");

            #endregion


            std.Realtime = false;

            for (int i = 0; i < config.num_Keepers; i++)
            {
                players.Add(new NEATKeepawayPlayer(std, "keepers", i + 1, "l", config.num_Keepers, config.num_Takers));
            }

            for (int i = 0; i < config.num_Takers; i++)
            {
                players.Add(new NEATKeepawayPlayer(std, "takers", i + 1, "r", config.num_Keepers, config.num_Takers));
            }

            for (int i = 0; i < players.Count; i++)
            {
                std.addPlayer(players[i]);
            }
        }
Exemple #2
0
 void WorkMethod()
 {
     config = KPExperimentConfig.Load("KPExperimentConfig.xml");
     while (_ea.CurrentGeneration <= config.num_Generations)
     {
         Thread.Sleep(Int32.MaxValue);
     }
 }
Exemple #3
0
        public FitnessInfo Evaluate(IBlackBox agent, out double[] behVector)
        {
            config = KPExperimentConfig.Load("KPExperimentConfig.xml");
            double fitness = 0;

            double[] values = new double[4];
            //synchronize the access to game controller
            lock (this)
            {
                //call a keepaway game controller
                fitness = NEATGame.FitnessValue(agent, out values);
            }
            behVector = values;
            _evalCount++;
            fitness /= scale;
            //termination condition
            if (fitness >= 1)
            {
                _stopConditionSatisfied = true;
            }

            return(new FitnessInfo(fitness, fitness));
        }