public DistributedSearch(string configFilename)
        {
            // Grab the configuration info
            _configFilename = configFilename;
            var config = Toml.ReadFile <Configuration>(_configFilename);

            // Console.WriteLine("NumFeatures: " + config.Map.Features.Length);
            // foreach (var p in config.Map.Features)
            // {
            //     Console.WriteLine(p.Name);
            // }

            // Configuration for the search space
            _heroClass = CardReader.GetClassFromName(config.Deckspace.HeroClass);
            CardSet[] sets = CardReader.GetSetsFromNames(config.Deckspace.CardSets);
            _cardSet = CardReader.GetCards(_heroClass, sets);

            // Setup the logs to record the data on individuals
            InitLogs();

            // Set up search algorithm
            Console.WriteLine("Algo: " + config.Search.Type);
            if (config.Search.Type.Equals("MAP-Elites"))
            {
                var searchConfig = Toml.ReadFile <MapElitesParams>(config.Search.ConfigFilename);
                _searchAlgo = new MapElitesAlgorithm(searchConfig);
            }

            else if (config.Search.Type.Equals("EvolutionStrategy"))
            {
                var searchConfig = Toml.ReadFile <EvolutionStrategyParams>(config.Search.ConfigFilename);
                _searchAlgo = new EvolutionStrategyAlgorithm(searchConfig);
            }
        }
Example #2
0
        public FracturingSearch(string configFilename)
        {
            // Grab the configuration info
            _configFilename = configFilename;
            var config = Toml.ReadFile <Configuration>(_configFilename);

            _params = config.Search;

            // Configuration for the search space
            _heroClass = CardReader.GetClassFromName(config.Deckspace.HeroClass);
            CardSet[] sets = CardReader.GetSetsFromNames(config.Deckspace.CardSets);
            _cardSet = CardReader.GetCards(_heroClass, sets);

            InitLogs();
        }
Example #3
0
        public EvolutionaryStrategies(string configFilename)
        {
            // Grab the config info
            _configFilename = configFilename;
            var config = Toml.ReadFile <Configuration>(_configFilename);

            _params = config.Search;

            // Configure the search space
            _heroClass = CardReader.GetClassFromName(config.Deckspace.HeroClass);
            CardSet[] sets = CardReader.GetSetsFromNames(config.Deckspace.CardSets);
            _cardSet = CardReader.GetCards(_heroClass, sets);

            // Setup the logs to record the data on individuals
            InitLogs();
        }
Example #4
0
        public MapElites(string configFilename)
        {
            // Grab the configuration info
            _configFilename = configFilename;
            var config = Toml.ReadFile <Configuration>(_configFilename);

            _params = config.Search;

            Console.WriteLine("NumFeatures: " + config.Map.Features.Length);
            foreach (var p in config.Map.Features)
            {
                Console.WriteLine(p.Name);
            }

            // Configuration for the search space
            _heroClass = CardReader.GetClassFromName(config.Deckspace.HeroClass);
            CardSet[] sets = CardReader.GetSetsFromNames(config.Deckspace.CardSets);
            _cardSet = CardReader.GetCards(_heroClass, sets);

            InitLogs();
            InitMap(config);
        }