AIMA.Core.Environment.Map.MapStepCostFunction.c C# (CSharp) Method

c() public method

public c ( System fromCurrentState, Action action, System toNextState ) : double
fromCurrentState System
action Action
toNextState System
return double
        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;
        }
MapStepCostFunction