public GenomeFactory(
     INeuralNetworkFactory neuralNetworkFactory,
     IEvolutionSettings <TSimulation> evolutionSettings)
 {
     this.neuralNetworkFactory = neuralNetworkFactory;
     this.evolutionSettings    = evolutionSettings;
 }
Ejemplo n.º 2
0
        public Genome(
            INeuralNetwork neuralNetwork,
            IEvolutionSettings <TSimulation> evolutionSettings)
        {
            this.evolutionSettings = evolutionSettings;

            Simulation    = evolutionSettings.SimulationFactoryMethod();
            NeuralNetwork = neuralNetwork;
        }
Ejemplo n.º 3
0
        public Generation(
            IEvolutionSettings <TSimulation> evolutionSettings,
            IGenomeFactory <TSimulation> genomeFactory)
        {
            genomes     = new HashSet <IGenome <TSimulation> >();
            bestGenomes = new LinkedList <IGenome <TSimulation> >();

            this.evolutionSettings = evolutionSettings;
            this.genomeFactory     = genomeFactory;
        }
Ejemplo n.º 4
0
        public static void AddFluffySpoonNeuroEvolution <TSimulation>(
            this IServiceCollection services,
            IEvolutionSettings <TSimulation> settings
            ) where TSimulation : ISimulation
        {
            services.AddSingleton(settings);
            services.AddSingleton <INeuralNetworkSettings>(settings);

            services.AddScoped(typeof(IGeneration <>), typeof(Generation <>));
            services.AddScoped(typeof(IGenomeFactory <>), typeof(GenomeFactory <>));

            services.AddScoped(typeof(INeuralNetworkFactory), typeof(AccordNeuralNetworkFactory));
        }