/// <summary> /// Construct with the provided IGenomeDecoder, ICoevolutionPhenomeEvaluator and ParalleOptions. /// The number of parallel threads defaults to Environment.ProcessorCount. /// </summary> public ParallelCoevolutionListEvaluator(IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeEvaluator <TPhenome> phenomeEvaluator, ParallelOptions options) { _genomeDecoder = genomeDecoder; _phenomeEvaluator = phenomeEvaluator; _parallelOptions = options; }
/// <summary> /// Construct with the provided number of generations per champion, weight to the hall /// of fame fitness, and other parameters. /// The number of parallel threads defaults to Environment.ProcessorCount. /// </summary> public ParallelHallOfFameListEvaluator(uint generationsPerChampion, double hallOfFameWeight, AbstractGenerationalAlgorithm <TGenome> ea, IGenomeListEvaluator <TGenome> innerEvaluator, IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeEvaluator <TPhenome> phenomeEvaluator) : this(generationsPerChampion, hallOfFameWeight, ea, innerEvaluator, genomeDecoder, phenomeEvaluator, new ParallelOptions()) { }
/// <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, ICoevolutionPhenomeEvaluator <TPhenome> phenomeEvaluator) : this(parasiteGenomesPerEvaluation, hallOfFameGenomesPerEvaluation, eaParasite, genomeDecoder, phenomeEvaluator, new ParallelOptions()) { }
/// <summary> /// Construct with the provided number of generations per champion, weight to the hall /// of fame fitness, parallel options, and other parameters. /// </summary> public ParallelHallOfFameListEvaluator(uint generationsPerChampion, double hallOfFameWeight, AbstractGenerationalAlgorithm <TGenome> ea, IGenomeListEvaluator <TGenome> innerEvaluator, IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeEvaluator <TPhenome> phenomeEvaluator, ParallelOptions options) { Debug.Assert(hallOfFameWeight >= 0d); Debug.Assert(hallOfFameWeight <= 1d); _generationsPerChampion = generationsPerChampion; _hallOfFameWeight = hallOfFameWeight; _innerEvaluator = innerEvaluator; _genomeDecoder = genomeDecoder; _phenomeEvaluator = phenomeEvaluator; _parallelOptions = options; _hallOfFame = new List <TGenome>(); ea.UpdateEvent += new EventHandler(ea_UpdateEvent); }
/// <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, ICoevolutionPhenomeEvaluator <TPhenome> phenomeEvaluator, ParallelOptions options) { Debug.Assert(parasiteGenomesPerEvaluation >= 0); Debug.Assert(hallOfFameGenomesPerEvaluation >= 0); _parasiteGenomesPerEvaluation = parasiteGenomesPerEvaluation; _hallOfFameGenomesPerEvaluation = hallOfFameGenomesPerEvaluation; _genomeDecoder = genomeDecoder; _phenomeEvaluator = phenomeEvaluator; _parallelOptions = options; _hallOfFame = new List <TGenome>(); _parasiteGenomes = new List <TGenome>(); _random = new FastRandom(); eaParasite.UpdateEvent += new EventHandler(eaParasite_UpdateEvent); }
/// <summary> /// Construct with the provided IGenomeDecoder and ICoevolutionPhenomeEvaluator. /// The number of parallel threads defaults to Environment.ProcessorCount. /// </summary> public ParallelCoevolutionListEvaluator(IGenomeDecoder <TGenome, TPhenome> genomeDecoder, ICoevolutionPhenomeEvaluator <TPhenome> phenomeEvaluator) : this(genomeDecoder, phenomeEvaluator, new ParallelOptions()) { }