예제 #1
0
        public MapElitesAlgorithm(MapElitesParams config)
        {
            _individualsDispatched = 0;
            _individualsEvaluated  = 0;
            _params = config;

            InitMap();
        }
예제 #2
0
        public MapElitesAlgorithm(MapElitesParams searchParams, int numParams)
        {
            _numParams = numParams;
            _params    = searchParams;

            _individualsEvaluated  = 0;
            _individualsDispatched = 0;

            initMap();
        }
예제 #3
0
        public MapElitesLineAlgorithm(MapElitesParams searchParams, int numParams)
        {
            _numParams = numParams;
            _params    = searchParams;

            _individualsEvaluated  = 0;
            _individualsDispatched = 0;
            _maxFitness            = Double.MinValue;

            initMap();
        }
예제 #4
0
        static void run_me_tuning(int id, double sigma)
        {
            int numParams = 20;

            var searchParams = new MapElitesSearchParams();

            searchParams.InitialPopulation = 100;
            searchParams.NumToEvaluate     = 50000;
            searchParams.MutationPower     = sigma;

            var feature1 = new FeatureParams();

            feature1.Name     = "Sum1";
            feature1.MinValue = -(numParams * boundaryValue) / 2.0;
            feature1.MaxValue = (numParams * boundaryValue) / 2.0;

            var feature2 = new FeatureParams();

            feature2.Name     = "Sum2";
            feature2.MinValue = -(numParams * boundaryValue) / 2.0;
            feature2.MaxValue = (numParams * boundaryValue) / 2.0;

            var mapParams = new MapParams();

            mapParams.Type      = "FixedFeature";
            mapParams.StartSize = 100;
            mapParams.EndSize   = 100;
            mapParams.Features  = new FeatureParams[] { feature1, feature2 };

            var meParams = new MapElitesParams();

            meParams.Search = searchParams;
            meParams.Map    = mapParams;

            double          maxValue = Double.MinValue;
            SearchAlgorithm search   = new MapElitesAlgorithm(0, meParams, numParams);

            while (search.IsRunning())
            {
                Individual cur = search.GenerateIndividual();
                cur.Fitness = evaluate(0, cur.ParamVector);
                maxValue    = Math.Max(cur.Fitness, maxValue);
                search.ReturnEvaluatedIndividual(cur);
            }
        }