public LocalSearch(IInitalise initalise, INeighbourhood neighbourhood, IStepFunction step, TerminateStrategy terminate, string name = "Local Search") { this.initalisationStrategy = initalise; this.neighbourhood = neighbourhood; this.step = step; this.terminateStrategy = terminate; this.name = name; }
public Particle(int dimentions, ParticleCostFunction costFunction, IInitalise initalise) { Velocity = Vector.FromDesign(initalise.Initalise(dimentions + 1)) / 2; Position = Vector.FromDesign(initalise.Initalise(dimentions + 1)); this.costFunction = costFunction; EvaluateCost(); }
public Evolution(IInitalise initalise, ISelectionStrategy selectionStrategy, ICrossover crossoverStratergy, ISwap swap, TerminateStrategy terminate, IStepFunction stepFunction, uint populationSize, float eliteism, float mutationRate, string name = "Evolution Search") { this.InitalisationStrategy = initalise; this.selectionStrategy = selectionStrategy; this.crossoverStratergy = crossoverStratergy; this.step = stepFunction; this.swap = swap; this.terminateStrategy = terminate; this.name = name; this.eliteism = eliteism; this.mutationRate = mutationRate; population = new Route[populationSize]; }