public override NeatEvolutionAlgorithm<NeatGenome> CreateEvolutionAlgorithm(IGenomeFactory<NeatGenome> genomeFactory, List<NeatGenome> genomeList) { // Create the evolution algorithm. var ea = DefaultNeatEvolutionAlgorithm; var evaluator = new RemoteBatchSixMultiplexerEvaluator(ea); IGenomeDecoder<NeatGenome, FastCyclicNetwork> genomeDecoder = _decoder; // Evaluates list of phenotypes IGenomeListEvaluator<NeatGenome> innerEvaluator = new BatchGenomeListEvaluator<NeatGenome, FastCyclicNetwork>( genomeDecoder, evaluator); // Weeds down the list to be evaluated IGenomeListEvaluator<NeatGenome> selectiveEvaluator = new SelectiveGenomeListEvaluator<NeatGenome>( innerEvaluator, SelectiveGenomeListEvaluator<NeatGenome>.CreatePredicate_OnceOnly()); ea.Initialize(selectiveEvaluator, genomeFactory, genomeList); return ea; }
public override NeatEvolutionAlgorithm <NeatGenome> CreateEvolutionAlgorithm(IGenomeFactory <NeatGenome> genomeFactory, List <NeatGenome> genomeList) { // Create the evolution algorithm. var ea = DefaultNeatEvolutionAlgorithm; var evaluator = new RemoteBatchSixMultiplexerEvaluator(ea); IGenomeDecoder <NeatGenome, FastCyclicNetwork> genomeDecoder = _decoder; // Evaluates list of phenotypes IGenomeListEvaluator <NeatGenome> innerEvaluator = new BatchGenomeListEvaluator <NeatGenome, FastCyclicNetwork>( genomeDecoder, evaluator); // Weeds down the list to be evaluated IGenomeListEvaluator <NeatGenome> selectiveEvaluator = new SelectiveGenomeListEvaluator <NeatGenome>( innerEvaluator, SelectiveGenomeListEvaluator <NeatGenome> .CreatePredicate_OnceOnly()); ea.Initialize(selectiveEvaluator, genomeFactory, genomeList); return(ea); }
public NeatEvolutionAlgorithm <NeatGenome> CreateEvolutionAlgorithm(IGenomeFactory <NeatGenome> genomeFactory, List <NeatGenome> genomeList) { // Create distance metric. Mismatched genes have a fixed distance of 10; for matched genes the distance is their weigth difference. IDistanceMetric distanceMetric = new ManhattanDistanceMetric(1.0, 0.0, 10.0); ISpeciationStrategy <NeatGenome> speciationStrategy = new KMeansClusteringStrategy <NeatGenome>(distanceMetric); // Create complexity regulation strategy. IComplexityRegulationStrategy complexityRegulationStrategy = ExperimentUtils.CreateComplexityRegulationStrategy("absolute", 10); // Create the evolution algorithm. var ea = new NeatEvolutionAlgorithm <NeatGenome>( NeatEvolutionAlgorithmParameters, speciationStrategy, complexityRegulationStrategy); // Create IBlackBox evaluator. // var evaluator = new RemoteXorEvaluator(); var evaluator = new RemoteBatchXorEvaluator(); //LocalXorEvaluator evaluator = new LocalXorEvaluator(); // Create genome decoder. IGenomeDecoder <NeatGenome, FastCyclicNetwork> genomeDecoder = _decoder; // Create a genome list evaluator. This packages up the genome decoder with the genome evaluator. IGenomeListEvaluator <NeatGenome> innerEvaluator = new BatchGenomeListEvaluator <NeatGenome, FastCyclicNetwork>(genomeDecoder, evaluator); // Wrap the list evaluator in a 'selective' evaulator that will only evaluate new genomes. That is, we skip re-evaluating any genomes // that were in the population in previous generations (elite genomes). This is determined by examining each genome's evaluation info object. IGenomeListEvaluator <NeatGenome> selectiveEvaluator = new SelectiveGenomeListEvaluator <NeatGenome>( innerEvaluator, SelectiveGenomeListEvaluator <NeatGenome> .CreatePredicate_OnceOnly()); // Initialize the evolution algorithm. ea.Initialize(selectiveEvaluator, genomeFactory, genomeList); // Finished. Return the evolution algorithm return(ea); }