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); } }
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); } }
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); }