public List <Street> possibleActions(Intersection start) { List <Street> toReturn = new List <Street>(); foreach (Street action in allStreets) { Intersection compare = action.Start(); bool check = (compare.X() == start.X()) && (compare.Y() == start.Y()); if (action.Start().equals(start)) { toReturn.Add(action); } } return(toReturn); }
// SOME TEST COMMENT FOR GITKRAKEN // SOME TEST FROM MATT private void computeStreetLength() { //street length == length of arrow from start to end streetLength = Convert.ToInt32(Math.Sqrt(Math.Pow(end.X() - start.X(), 2) + Math.Pow(end.Y() - start.Y(), 2))); }
public int heuristic(Intersection currentState) { //straigth line from currentState to goalState. //Converting double to int. Consider rounding it. return(Convert.ToInt32(Math.Sqrt(Math.Pow(goalState.X() - currentState.X(), 2) + Math.Pow(goalState.Y() - currentState.Y(), 2)))); //return 0; }
public bool equals(Intersection check) { return((check.X() == this.x) && (check.Y() == this.y)); }