private bool withinRadius(int radius, XYLocation agentLocation,
XYLocation objectLocation)
{
int xdifference = agentLocation.getXCoOrdinate()
- objectLocation.getXCoOrdinate();
int ydifference = agentLocation.getYCoOrdinate()
- objectLocation.getYCoOrdinate();
return Math.sqrt((xdifference * xdifference)
+ (ydifference * ydifference)) <= radius;
}
}