Class EuclideanCostFunction

    • Constructor Detail

      • EuclideanCostFunction

        public EuclideanCostFunction​(int userDataCategory,
                                     int xCoordUserDataIndex,
                                     int yCoordUserDataIndex,
                                     int geometryUserDataIndex)
        Creates a EuclideanCostFunction instance. The input parameters are interpreted as follows:
        If neither xCoordUserDataName nor yCoordUserDataName is null, then the the heuristic cost is computed using the x and y coordinates stored as user data of the nodes;
        Else if geometryUserDataName is not null, then the heuristic cost is computed using the JGeometry object stored as user data of the nodes.
        Parameters:
        userDataCategory - user data category
        xCoordUserDataIndex - user data index registered for x coordinates of the nodes or points on link
        yCoordUserDataIndex - user data index registered for y coordinates of the nodes or points on link
        geometryUserDataIndex - user date index registered for geometries of the nodes or points on link
    • Method Detail

      • getHeuristicCost

        public double getHeuristicCost​(double x1,
                                       double y1,
                                       double x2,
                                       double y2)
        The implementation of this abstract method should return the heuristic cost between point (x1, y1) and (x2, y2).
        Parameters:
        x1 - x coordinate of the current point
        y1 - y coordinate of the current point
        x2 - x coordinate of the goal point
        y2 - y coordinate of the goal point
        Returns:
      • init

        public void init​(org.w3c.dom.Element parameter)
      • getXMLSchema

        public java.lang.String getXMLSchema()
      • getHeuristicCost

        public double getHeuristicCost​(HeavyPointOnNet currentPoint,
                                       HeavyPointOnNet goalPoint)
        Returns the heuristic cost between the current node and the goal node.
        Parameters:
        currentPoint - current point
        goalPoint - goal point
        Returns:
      • getHeuristicCostXY

        protected double getHeuristicCostXY​(HeavyPointOnNet currentPoint,
                                            HeavyPointOnNet goalPoint)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in user data x and y of or the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentPoint - current point
        goalPoint - goal point
        Returns:
      • getHeuristicCostGeometry

        protected double getHeuristicCostGeometry​(HeavyPointOnNet currentPoint,
                                                  HeavyPointOnNet goalPoint)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in the geometry user data of the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentPoint - current point
        goalPoint - goal point
        Returns:
      • getHeuristicCost

        public double getHeuristicCost​(LogicalNode currentNode,
                                       LogicalNode goalNode)
        Returns the heuristic cost between the current node and the goal node.
        Parameters:
        currentNode - current node
        goalNode - goal node
        Returns:
      • getHeuristicCostXY

        protected double getHeuristicCostXY​(LogicalNode currentNode,
                                            LogicalNode goalNode)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in user data x and y of or the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentNode - current node
        goalNode - goal node
        Returns:
      • getHeuristicCostGeometry

        protected double getHeuristicCostGeometry​(LogicalNode currentNode,
                                                  LogicalNode goalNode)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in the geometry user data of the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentNode - current node
        goalNode - goal node
        Returns:
      • getHeuristicCost

        public double getHeuristicCost​(LogicalNode currentNode,
                                       HeavyPointOnNet goalPoint)
        Returns the heuristic cost between the current node and the goal node.
        Parameters:
        currentNode - current node
        goalPoint - goal point
        Returns:
      • getHeuristicCostXY

        protected double getHeuristicCostXY​(LogicalNode currentNode,
                                            HeavyPointOnNet goalPoint)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in user data x and y of or the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentNode - current node
        goalPoint - goal point
        Returns:
      • getHeuristicCostGeometry

        protected double getHeuristicCostGeometry​(LogicalNode currentNode,
                                                  HeavyPointOnNet goalPoint)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in the geometry user data of the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentNode - current node
        goalPoint - goal point
        Returns:
      • getHeuristicCost

        public double getHeuristicCost​(HeavyPointOnNet currentPoint,
                                       LogicalNode goalNode)
        Returns the heuristic cost between the current node and the goal node.
        Parameters:
        currentPoint - current point
        goalNode - goal node
        Returns:
      • getHeuristicCostXY

        protected double getHeuristicCostXY​(HeavyPointOnNet currentPoint,
                                            LogicalNode goalNode)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in user data x and y of or the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentPoint - current point
        goalNode - goal node
        Returns:
      • getHeuristicCostGeometry

        protected double getHeuristicCostGeometry​(HeavyPointOnNet currentPoint,
                                                  LogicalNode goalNode)
        Returns the heuristic cost between two points, where the coordinates of the points are stored in the geometry user data of the nodes. When this method is used requiresUserData() must return true.
        Parameters:
        currentPoint - current point
        goalNode - goal node
        Returns:
      • getHeuristicCost

        protected double getHeuristicCost​(JGeometry currGeom,
                                          JGeometry goalGeom)
        Returns the distance between two point geometries.
        Parameters:
        currGeom - current geometry
        goalGeom - goal geometry
        Returns:
      • getUserDataCategories

        public int[] getUserDataCategories()