/// <summary> /// Construct with the provided IGenomeDecoder, ICoevolutionPhenomeEvaluator and ParalleOptions. /// The number of parallel threads defaults to Environment.ProcessorCount. /// </summary> public MusicListModulesEvaluator(String name, int parasiteGenomesPerEvaluation, int hallOfFameGenomesPerEvaluation, ModuleNeatEvolutionAlgorithm <TGenome> algorithm, List <ModuleNeatEvolutionAlgorithm <TGenome> > eaParasites, IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeListEvaluator <TPhenome> phenomeListEvaluator, ParallelOptions options) { Debug.Assert(parasiteGenomesPerEvaluation >= 0); Debug.Assert(hallOfFameGenomesPerEvaluation >= 0); HostName = name; _parasiteGenomesPerEvaluation = parasiteGenomesPerEvaluation; _hallOfFameGenomesPerEvaluation = hallOfFameGenomesPerEvaluation; _genomeDecoder = genomeDecoder; _phenomeListEvaluator = phenomeListEvaluator; _parallelOptions = options; _eaParasites = eaParasites; _hallOfFame = new List <TGenome>(); _random = new Random(); _parasiteGenomes = new List <TGenome> [MusicEnvironment.MODULE_COUNT - 1]; for (int i = 0; i < _parasiteGenomes.Length; i++) { _parasiteGenomes[i] = new List <TGenome>(); } algorithm.UpdateEvent += new EventHandler(eaParasite_UpdateEvent); }
/// <summary> /// Construct with the provided IGenomeDecoder and ICoevolutionPhenomeEvaluator. /// The number of parallel threads defaults to Environment.ProcessorCount. /// </summary> public HostParasiteCoevolutionListEvaluator(int parasiteGenomesPerEvaluation, int hallOfFameGenomesPerEvaluation, IEvolutionAlgorithm <TGenome> eaParasite, IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeListEvaluator <TPhenome> phenomeListEvaluator) : this(parasiteGenomesPerEvaluation, hallOfFameGenomesPerEvaluation, eaParasite, genomeDecoder, phenomeListEvaluator, new ParallelOptions()) { }
/// <summary> /// Construct with the provided IGenomeDecoder and ICoevolutionPhenomeEvaluator. /// The number of parallel threads defaults to Environment.ProcessorCount. /// </summary> public MusicListModulesEvaluator(String name, int parasiteGenomesPerEvaluation, int hallOfFameGenomesPerEvaluation, ModuleNeatEvolutionAlgorithm <TGenome> algorithm, List <ModuleNeatEvolutionAlgorithm <TGenome> > eaParasites, IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeListEvaluator <TPhenome> phenomeListEvaluator) : this(name, parasiteGenomesPerEvaluation, hallOfFameGenomesPerEvaluation, algorithm, eaParasites, genomeDecoder, phenomeListEvaluator, new ParallelOptions()) { }
/// <summary> /// Construct with the provided IGenomeDecoder, ICoevolutionPhenomeEvaluator and ParalleOptions. /// The number of parallel threads defaults to Environment.ProcessorCount. /// </summary> public HostParasiteCoevolutionListEvaluator(int parasiteGenomesPerEvaluation, int hallOfFameGenomesPerEvaluation, IEvolutionAlgorithm <TGenome> eaParasite, IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeListEvaluator <TPhenome> phenomeListEvaluator, ParallelOptions options) { Debug.Assert(parasiteGenomesPerEvaluation >= 0); Debug.Assert(hallOfFameGenomesPerEvaluation >= 0); _parasiteGenomesPerEvaluation = parasiteGenomesPerEvaluation; _hallOfFameGenomesPerEvaluation = hallOfFameGenomesPerEvaluation; _genomeDecoder = genomeDecoder; _phenomeListEvaluator = phenomeListEvaluator; _parallelOptions = options; _hallOfFame = new List <TGenome>(); _parasiteGenomes = new List <TGenome>(); _random = new Random(); eaParasite.UpdateEvent += new EventHandler(eaParasite_UpdateEvent); }