public double c(System.Object fromCurrentState, Action action, System.Object toNextState)
{
System.String fromLoc = fromCurrentState.ToString();
System.String toLoc = toNextState.ToString();
System.Double distance = map.getDistance(fromLoc, toLoc);
if (distance == null || distance <= 0)
{
return constantCost;
}
return distance;
}