public Algorithm(int generation, double probability, AlgorithmType type, IParentSelection parentSelection) { numberOfGenerations = generation; probabilityOfMutation = probability; typeOfAlgorithm = type; this.parentSelection = parentSelection; }
public Generation(List <Individual> population, double probability, AlgorithmType type, IParentSelection parentSelection) { startingPopulation = population; probabilityOfMutation = probability; typeOfAlgorithm = type; this.parentSelection = parentSelection; }
public Generation(Individual[] currentPopulation, Cities cities, IParentSelection parentSelection, ICrossover crossoverOperator, IMutation methodOfMutation) { this.population = currentPopulation; this.cities = cities; this.parentSelection = parentSelection; this.crossoverOperator = crossoverOperator; this.methodOfMutation = methodOfMutation; }
public Algorithm(int generation, int execution, double probability, AlgorithmType type, IParentSelection parentSelection) { numberOfGenerations = generation; numberOfExecution = execution; probabilityOfMutation = probability; typeOfAlgorithm = type; arrayOfBestResults = new double[execution]; this.parentSelection = parentSelection; }
public TSPAlgorithm(int numberOfGenerations, int populationSize, Cities cities, IParentSelection parentSelection, IMutation methodOfMutation, ICrossover crossoverOperator) { this.numberOfGenerations = numberOfGenerations; this.populationSize = populationSize; this.cities = cities; this.parentSelection = parentSelection; this.crossoverOperator = crossoverOperator; this.methodOfMutation = methodOfMutation; this.bestResults = new double[numberOfGenerations]; }
public SolutionStrategyFactory( IRandomSolutionGenerator randomSolutionGenerator, IParentSelection parentSelection, IRecombination recombination, IBestSolutionFinder bestSolutionFinder, IMutation mutation, ISolutionEvaluator solutionEvaluator, IAdptiveChanceAdjuster adptiveChanceAdjuster, ICSVFileWriter csvFileWriter ) { this.randomSolutionGenerator = randomSolutionGenerator; this.parentSelection = parentSelection; this.recombination = recombination; this.bestSolutionFinder = bestSolutionFinder; this.mutation = mutation; this.solutionEvaluator = solutionEvaluator; this.adptiveChanceAdjuster = adptiveChanceAdjuster; this.csvFileWriter = csvFileWriter; }
public EvolutionarySolution( IRandomSolutionGenerator randomSolutionGenerator, IParentSelection parentSelection, IRecombination recombination, IBestSolutionFinder bestSolutionFinder, IMutation mutation, ISolutionEvaluator solutionEvaluator, IAdptiveChanceAdjuster adptiveChanceAdjuster ) { this.randomSolutionGenerator = randomSolutionGenerator; this.parentSelection = parentSelection; this.recombination = recombination; this.bestSolutionFinder = bestSolutionFinder; this.mutation = mutation; this.solutionEvaluator = solutionEvaluator; this.adptiveChanceAdjuster = adptiveChanceAdjuster; solutions = new Dictionary <int, Solution>(); parentPopulation = new List <Solution>(); offspringPopulation = new List <Solution>(); }
public void SetUp() { // This can't be good practice. is there a way to set a constant value both locally and temporarily? EvolutionaryAlgorithmConstants.TOURNAMENT_SIZE = 5; parentSelection = new ParentSelection(); }