Beispiel #1
0
        /// <summary>
        /// Parematers are explained in <see cref="AiController"/>
        /// </summary>
        public static IGeneration Create(
            int inputs,
            int[] hiddenLayers,
            int outputs,
            int genomes,
            int elitism,
            int freshGenomes,
            int breedChilds,
            float mutationRate,
            float mutationRange,
            Func <float, float> activationFunction)
        {
            var evolution = new NeuroevolutionGeneration(inputs,
                                                         hiddenLayers,
                                                         outputs,
                                                         genomes,
                                                         elitism,
                                                         freshGenomes,
                                                         breedChilds,
                                                         mutationRate,
                                                         mutationRange,
                                                         activationFunction,
                                                         NewGeneration(inputs, hiddenLayers, outputs, genomes));

            return(evolution);
        }
Beispiel #2
0
 private void Start()
 {
     Generation = NeuroevolutionGeneration.Create(
         Inputs,
         HiddenLayers,
         Outputs,
         Genomes,
         Elitism,
         FreshGenomes,
         BreedChilds,
         MutationRate,
         MutationRange,
         ActivationFunction.FromType(ActivationFunctionType));
 }
Beispiel #3
0
 public void Load(byte[] bytes)
 {
     Generation = NeuroevolutionGeneration.Load(bytes,
                                                ActivationFunction.FromType(ActivationFunctionType));
 }