/// <summary> /// Find the current square on the map you reside in. Each square has a weight and angle. /// Grid multiplier determines how many squares the grid (map) is broken into. /// The smaller the gridmultiplier, the more preces the neural network. /// </summary> void currentSpace(double x, double z) { float nearestX = findNearest(x); float nearestZ = findNearest(z); XZKey currentKey = new XZKey (nearestX,nearestZ); weightAngleTimesVisited test = new weightAngleTimesVisited (22, 45, 3); //FOR TESTING if (containsKey(neuralValues, currentKey) == false) { neuralValues.Add(currentKey,test); } }
bool containsKey(Dictionary<XZKey, weightAngleTimesVisited> neuralValues, XZKey currentKey) { bool found = false; for (int i = 0; i<neuralValues.Count; i++){ if(neuralValues.Keys.ElementAt(i).X == currentKey.X && neuralValues.Keys.ElementAt(i).Z == currentKey.Z){ found = true; } } return found; }