Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
aStar Routing method
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Carol Hansen  
View profile  
 More options Jul 27 2012, 4:32 pm
From: Carol Hansen <carolbhan...@gmail.com>
Date: Fri, 27 Jul 2012 15:32:34 -0500
Local: Fri, Jul 27 2012 4:32 pm
Subject: aStar Routing method

Hello,

I am trying to utilize the aStar routing method (took your advice, Rafal.
Thank you!!) within the GraphAlgoFactory. But I am not sure how to utilize
the "EstimateEvaluator".
In the JavaDocs under "Use"...I obtained the following example
*CommonEvaluators.**geoEstimateEvaluator<http://api.neo4j.org/current/org/neo4j/graphalgo/CommonEvaluators.htm...,
java.lang.String)>*(String<http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is...>
 latitudePropertyKey,
String<http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is...>
 longitudePropertyKey)

1) Do I need to use geoEstimateEvaluator? My Nodes already have lat/lon
properties in them. Do I simply pass the lat/lon for the endNode?

2) Also, am I using my Path variable ("route") properly? Will this return
the actual path that I can then iterate through and print?

So far, I have the following code for my method:
   public void createRoute()
{
    PathFinder<Path> finder = GraphAlgoFactory.aStar(
                Traversal.expanderForTypes( RelTypes.OSM_NODENEXT,
Direction.BOTH) ,
CommonEvaluators.doubleCostEvaluator("distance_in_meters"),
EstimateEvaluator );
    String startNodeID;
String endNodeID;
Path route;
startNodeID = JOptionPane.showInputDialog("Enter nodeID for the Start Node:
");
endNodeID = JOptionPane.showInputDialog("Enter nodeID for the End Node: ");

long startNode = Long.valueOf(startNodeID);
   long endNode = Long.valueOf(endNodeID);
   Node start = graphDb.getNodeById(startNode);
   Node end = graphDb.getNodeById(endNode);
   route = finder.findSinglePath(start, end);

}//end createRoute()

Thank you for any advice!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Neubauer  
View profile  
 More options Jul 28 2012, 6:17 am
From: Peter Neubauer <neubauer.pe...@gmail.com>
Date: Sat, 28 Jul 2012 12:17:52 +0200
Local: Sat, Jul 28 2012 6:17 am
Subject: Re: [Neo4j] aStar Routing method

Carol,
There is an example project at
https://github.com/neo4j-examples/java-astar-routing that you can look at?

/peter

Send from mobile.
On Jul 27, 2012 10:32 PM, "Carol Hansen" <carolbhan...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »