public void StartCrossover(Airfoil.CombinedAirfoilsGroup parents) { parentAirfoils = parents; var parentsAirfoilsArray = parentAirfoils.CombinedAirfoils; // Initialize Basis airfoils basisAirfoils = new General.BasisAirfoils(parentAirfoils.BasisAirfoils.AirfoilGroup); // Execute Crossover crossoverExecutor.ExecuteCrossover(parentAirfoils.CoefficientOfCombination); // Read Offsprings' optimization parameters var optParams = crossoverExecutor.OptimizationParamters; optParams = SwapJuggedArray(optParams); var optCoef = new Airfoil.CoefficientOfCombination(General.ArrayManager.ConvertJuggedArrayToArray(optParams)); // Assign Selected Parents Index parentsIndex = crossoverExecutor.ParentsIndex; // Initialize each fields offspringAirfoilsCombiner = new Airfoil.CombinedAirfoilsGroup(basisAirfoils); Airfoil.AirfoilsMixer airfoilsMixer = new Airfoil.AirfoilsMixer(basisAirfoils, optCoef); // Create Offspring Airfoils // Combine airfoils airfoilsMixer.CombineAirfoils(); // Store combined airfoils into CombinedAirfoilsGroup class offspringAirfoilsCombiner.AddRange(airfoilsMixer.CombinedAirfoils); }
private Airfoil.CombinedAirfoilsGroup CreateOffspringAirfoils(Airfoil.CoefficientOfCombination optParams) { Airfoil.CombinedAirfoilsGroup offsprings = new Airfoil.CombinedAirfoilsGroup(basisAirfoils); Airfoil.AirfoilsMixer airfoilsMixer = new Airfoil.AirfoilsMixer(basisAirfoils, optParams); airfoilsMixer.CombineAirfoils(); offspringAirfoils.AddRange(airfoilsMixer.CombinedAirfoils); return(offsprings); }