Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <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())
 {
 }
Ejemplo n.º 3
0
 public Module(int id, NeatEvolutionAlgorithmParameters evolutionAlgorithmParameters,
               ISpeciationStrategy <NeatGenome> speciationStrategyPitch, ISpeciationStrategy <NeatGenome> speciationStrategyRhythm,
               IComplexityRegulationStrategy complexityRegulationStrategyPitch, IComplexityRegulationStrategy complexityRegulationStrategyRhythm)
 {
     Name = "M" + id;
     Id   = id;
     //RhythmEvolutionAlgorithm = new NeatEvolutionAlgorithm<NeatGenome>(evolutionAlgorithmParameters, speciationStrategyRhythm, complexityRegulationStrategyRhythm);
     //PitchEvolutionAlgorithm = new NeatEvolutionAlgorithm<NeatGenome>(evolutionAlgorithmParameters, speciationStrategyPitch, complexityRegulationStrategyPitch);
     RhythmEvolutionAlgorithm = new ModuleNeatEvolutionAlgorithm <NeatGenome>(Name + "_R", Id, evolutionAlgorithmParameters, speciationStrategyRhythm, complexityRegulationStrategyRhythm);
     PitchEvolutionAlgorithm  = new ModuleNeatEvolutionAlgorithm <NeatGenome>(Name + "_P", Id, evolutionAlgorithmParameters, speciationStrategyPitch, complexityRegulationStrategyPitch);
 }