public override void Initialize(string name, XmlElement xmlConfig, IDataLogger evolutionDataLogger, IDataLogger evaluationDataLogger) { base.Initialize(name, xmlConfig, evolutionDataLogger, evaluationDataLogger); // Read in the behavior characterization _behaviorCharacterizationFactory = ExperimentUtils.ReadBehaviorCharacterizationFactory(xmlConfig, "BehaviorConfig"); // Read in number of offspring to produce in a single batch _batchSize = XmlUtils.GetValueAsInt(xmlConfig, "OffspringBatchSize"); // Read in the bridging magnitude and number of applications _bridgingMagnitude = XmlUtils.TryGetValueAsInt(xmlConfig, "BridgingMagnitude") ?? default(int); _bridgingApplications = XmlUtils.TryGetValueAsInt(xmlConfig, "BridgingApplications") ?? default(int); // Read in the number of seed genomes to generate to bootstrap the primary algorithm SeedGenomeCount = XmlUtils.GetValueAsInt(xmlConfig, "SeedGenomeCount"); // Read in log file path/name _evolutionDataLogger = evolutionDataLogger ?? ExperimentUtils.ReadDataLogger(xmlConfig, LoggingType.Evolution); _evaluationDataLogger = evaluationDataLogger ?? ExperimentUtils.ReadDataLogger(xmlConfig, LoggingType.Evaluation); // Setup the specific logging options based on parameters that are enabled/disabled _experimentLogFieldEnableMap = EvolutionFieldElements.PopulateEvolutionFieldElementsEnableMap(); // Enable or disable genome XML logging if (SerializeGenomeToXml == false) { _experimentLogFieldEnableMap.Add(EvolutionFieldElements.ChampGenomeXml, false); } // Enable or disable primary fitness logging (causing utilization of auxiliary fitness) if (_bridgingMagnitude > 0) { _experimentLogFieldEnableMap.Add(EvolutionFieldElements.ChampGenomeFitness, false); } // Initialize the initialization algorithm _mazeNavigationInitializer = new NoveltySearchMazeNavigationInitializer(MaxEvaluations, _evolutionDataLogger, _evaluationDataLogger, SerializeGenomeToXml); // Setup initialization algorithm _mazeNavigationInitializer.SetAlgorithmParameters( xmlConfig.GetElementsByTagName("InitializationAlgorithmConfig", "")[0] as XmlElement, InputCount, OutputCount); // Pass in maze experiment specific parameters _mazeNavigationInitializer.SetEnvironmentParameters(MaxDistanceToTarget, MaxTimesteps, MazeVariant, MinSuccessDistance); }
public override void Initialize(ExperimentDictionary experimentDictionary) { base.Initialize(experimentDictionary); // Read in the behavior characterization _behaviorCharacterizationFactory = ExperimentUtils.ReadBehaviorCharacterizationFactory( experimentDictionary, true); // Read in number of offspring to produce in a single batch _batchSize = experimentDictionary.Primary_OffspringBatchSize ?? default(int); // Read in the bridging magnitude _bridgingMagnitude = experimentDictionary.Primary_MCS_BridgingMagnitude ?? default(int); _bridgingApplications = experimentDictionary.Primary_MCS_BridgingApplications ?? default(int); // TODO: Read seed genome count from the database // Read in log file path/name _evolutionDataLogger = new McsExperimentEvaluationEntityDataLogger(experimentDictionary.ExperimentName); _evaluationDataLogger = new McsExperimentOrganismStateEntityDataLogger(experimentDictionary.ExperimentName); // Initialize the initialization algorithm _mazeNavigationInitializer = new NoveltySearchMazeNavigationInitializer(MaxEvaluations, _evolutionDataLogger, _evaluationDataLogger, SerializeGenomeToXml); // Setup initialization algorithm _mazeNavigationInitializer.SetAlgorithmParameters(experimentDictionary, InputCount, OutputCount); // Pass in maze experiment specific parameters _mazeNavigationInitializer.SetEnvironmentParameters(MaxDistanceToTarget, MaxTimesteps, MazeVariant, MinSuccessDistance); }