public JPSStrategy(FMap fMap, FMap gMap, string id) : base(fMap, id) { openSet = new List <Point>(); parent = new Dictionary <Point, Point>(); this.gMap = gMap; }
public GAStrategy(FMap fMap, string id, GAOpts opt) : base(fMap, id) { rng = new Random(Guid.NewGuid().GetHashCode()); popSize = opt.popSize; // population size mutRate = opt.mutRate; // mutation rate fitnessMulti = opt.fitMulti; //fitness multiplier ValueDiversity = opt.diversity; //whether we value candidate diversity or not Elite = opt.elite; //Mix in the genes of the best path found when creating next generations deepCount = 1; deepeningInc = opt.deepeningInc; parents = new Individual[Math.Max((int)(popSize * 0.1), 2)]; //parents as a fifth of the population dnaPool = new List <MasterGene>(); //action counter for crossovers BestDNA = new List <MoveDir>(); //initialise generation generation = new Individual[popSize]; for (int i = 0; i < popSize; i++) { generation[i] = new Individual(fMap.Start); } started = false; }
protected SearchStrategy(FMap fMap, string id) { this.id = id; this.fMap = fMap; closedSet = new Dictionary <Point, bool>(); for (int i = 0; i < fMap.Width; i++) { for (int j = 0; j < fMap.Height; j++) { closedSet[new Point(i, j)] = false; } } Path = new List <Point>(); paused = true; gridW = SwinGame.ScreenWidth() / fMap.Width; gridH = SwinGame.ScreenHeight() - 200 / fMap.Height; gridW = gridH = gridW < gridH ? gridW : gridH; sw = new Stopwatch(); sw.Reset(); }
public BFSStrategy(FMap fMap, string id) : base(fMap, id) { openSet = new List <Point>(); parent = new Dictionary <Point, Point>(); }
public DFSStrategy(FMap fMap, string id) : base(fMap, id) { stack = new Stack <Point>(); }