// TODO: Creation of an IGenomeListEvaluator needs to be the responsibility of INeatExperimentFactory (or the evaluation scheme), // to allow for tasks that require the entire population to be evaluated as a whole, e.g. simulated life/worlds. // Furthermore, a new interface IPhenomeListEvaluator will be needed to allow the code for those types of task to be abstracted away from the type of genome in use. private static IGenomeListEvaluator <NeatGenome <double> > CreateGenomeListEvaluator( INeatExperiment <double> neatExperiment) { // Create a genome decoder based on experiment config settings. var genomeDecoder = CreateGenomeDecoder(neatExperiment); // Resolve degreeOfParallelism (-1 is allowed in config, but must be resolved here to an actual degree). int degreeOfParallelismResolved = ResolveDegreeOfParallelism(neatExperiment); // Create a genomeList evaluator, and return. var genomeListEvaluator = GenomeListEvaluatorFactory.CreateEvaluator( genomeDecoder, neatExperiment.EvaluationScheme, degreeOfParallelismResolved); return(genomeListEvaluator); }
private IGenomeListEvaluator <NeatGenome <double> > CreateGenomeListEvaluator( out int inputCount, out int outputCount) { var genomeDecoder = NeatGenomeDecoderFactory.CreateGenomeAcyclicDecoder(true); IBlackBoxEvaluationScheme <double> blackBoxEvaluationScheme = new BinaryElevenMultiplexerEvaluationScheme(); //// Create function regression evaluation scheme. //int sampleResolution = 20; //double sampleMin = 0; //double sampleMax = 6.283185; //var paramSamplingInfo = new ParamSamplingInfo(sampleMin, sampleMax, sampleResolution); //IBlackBoxEvaluationScheme<double> blackBoxEvaluationScheme = new FuncRegressionEvaluationScheme(FunctionFactory.GetFunction(FunctionId.Sin), paramSamplingInfo, 0.3); var genomeListEvaluator = GenomeListEvaluatorFactory.CreateEvaluator( genomeDecoder, blackBoxEvaluationScheme, createConcurrentEvaluator: true); inputCount = blackBoxEvaluationScheme.InputCount; outputCount = blackBoxEvaluationScheme.OutputCount; return(genomeListEvaluator); }