Ejemplo n.º 1
0
        // Use this for initialization
        void Start()
        {
            _settings = IOHandler.ParseSettings();

            SetSettingsText();
            SetGenerationText(0);

            LogExection("Initialise environment");

            LogExection(string.Format("Initial population: {0} - Chromosomes per gene: {1}", _settings.Population, _settings.GeneSize));

            Maze.InitMaze(this, _settings.RandomFruitPositions);

            Pacman.SetAlgorithm(new GeneticAlgorithm(_settings, AgentType.Fruit, AgentType.Ghost));

            Ghost = Ghosts[0];

            Ghost.SetAlgorithm(new GeneticAlgorithm(_settings, AgentType.Pacman, AgentType.None));

            SetNextGenes();

            _fruitsCollected = 0;
            SetFruitsCollected(0);

            IOHandler.DeleteOldLogs();

            LogExection("Start population fitness measurement");
        }