Exemple #1
0
 private void InitLogs()
 {
     _individualLog =
         new RunningIndividualLog(INDIVIDUAL_LOG_FILENAME);
     _championLog =
         new RunningIndividualLog(CHAMPION_LOG_FILENAME);
     _fittestLog =
         new RunningIndividualLog(FITTEST_LOG_FILENAME);
 }
Exemple #2
0
        public FittestPopulation(int maxPopulation)
        {
            _maxPopulation   = maxPopulation;
            _populationDeque = new IntervalHeap <Shard>(new ShardComparer());

            _maxWins    = 0;
            _maxFitness = Int32.MinValue;

            _champion_log =
                new RunningIndividualLog(CHAMPION_LOG_FILENAME);
            _fittest_log =
                new RunningIndividualLog(FITTEST_LOG_FILENAME);
        }
Exemple #3
0
        public MapPopulation(int maxPopulation)
        {
            _maxPopulation   = maxPopulation;
            _populationDeque = new IntervalHeap <Shard>(new ShardComparer());
            _featureMap      = new FeatureMap(NUM_FEATURES, REMAP_FREQUENCY,
                                              NUM_GROUPS_PER_FEATURE);

            _maxWins    = 0;
            _maxFitness = Int32.MinValue;

            _champion_log =
                new RunningIndividualLog(CHAMPION_LOG_FILENAME);
            _fittest_log =
                new RunningIndividualLog(FITTEST_LOG_FILENAME);
            _map_log =
                new FrequentMapLog(ELITE_MAP_FILENAME, _featureMap);
        }
Exemple #4
0
        static void run_search(Configuration config, int trialID)
        {
            int fid = config.FunctionType == "Rastrigin" ? 1 : 0;

            double[] trialVector = new double[config.NumParams];
            for (int i = 0; i < config.NumParams; i++)
            {
                trialVector[i] = -boundaryValue;
            }
            maxFitnessValue    = evaluate(fid, trialVector);
            fitnessScalarValue = -100.0 / maxFitnessValue;

            int individualCount = 0;
            RunningIndividualLog individualLog = null;

            if (config.Search.LogIndividuals)
            {
                string logFilepath = string.Format("logs/individuals_{0}.csv", trialID);
                individualLog = new RunningIndividualLog(logFilepath);
            }

            SearchAlgorithm algo = generate_search(trialID, config.Search, config.NumParams);

            while (algo.IsRunning())
            {
                Individual cur = algo.GenerateIndividual();
                cur.ID          = individualCount++;
                cur.Fitness     = evaluate(fid, cur.ParamVector);
                cur.NormFitness = norm_fitness(cur.Fitness);

                if (config.Search.LogIndividuals)
                {
                    individualLog.LogIndividual(cur);
                }

                algo.ReturnEvaluatedIndividual(cur);
            }
        }
Exemple #5
0
 private void InitLogs()
 {
     _individualLog =
         new RunningIndividualLog(INDIVIDUAL_LOG_FILENAME);
 }