Esempio n. 1
0
            public GeneticInstance(GeneticInstance parent, MutationArguments mutator)
            {
                CurrentScore          = 0.0f;
                ControllerGeneticData = new List <TuneableController>(parent.ControllerGeneticData.Count);

                foreach (var controller in parent.ControllerGeneticData)
                {
                    var childController = controller.DeepCopy();
                    childController.Mutate(mutator);
                    ControllerGeneticData.Add(childController);
                }
            }
Esempio n. 2
0
            public GeneticInstance(PIDTunerRequirements requirements, MutationArguments mutator)
            {
                CurrentScore          = 0.0f;
                ControllerGeneticData = new List <TuneableController>(requirements.Controllers.Count);

                foreach (var controller in requirements.Controllers)
                {
                    var controllerCopy = controller.Controller.DeepCopy();
                    controllerCopy.Mutate(mutator);
                    ControllerGeneticData.Add(controllerCopy);
                }
            }
Esempio n. 3
0
        public GeneticTuner(PIDTunerRequirements requirements, MutationArguments mutator, GenerationArguments generationArguments)
        {
            if (requirements == null)
            {
                throw new ArgumentNullException(nameof(requirements));
            }

            _mutator             = mutator ?? throw new ArgumentNullException(nameof(mutator));
            _generationArguments = generationArguments;
            _generationArguments.Validate();

            CurrentGeneration = 0;

            InitPopulation(requirements, _generationArguments);
        }