public Generator(int population, int cityCount, int generations, double mutationRate, int seed) { this.logger = new GeneratorLogger(); this.population = population; this.cityCount = cityCount; this.generations = generations; this.mutationRate = mutationRate; this.seed = seed; this.abstractFactory = new AbstractFactory(); this.cityFactory = abstractFactory.CreateCityFactory(this.seed); this.breedingFactory = abstractFactory.CreateBreedingFactory(); ISolutionFactory solutionFactory = abstractFactory.CreateSolutionFactory(); IMutater mutater = breedingFactory.CreateMutater(mutationRate); this.solutionFactory = solutionFactory; this.bestFit = new BestFit(); this.breeder = breedingFactory.CreateBreeder(mutater, solutionFactory); }
public Breeder(IMutater mutater, ISolutionFactory solutionFactory) { this.mutater = mutater; this.solutionFactory = solutionFactory; }
public IBreeder CreateBreeder(IMutater mutater, ISolutionFactory solutionFactory) { return(new Breeder(mutater, solutionFactory)); }