• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A* algorithm not looking every where

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My problem is that right now my A* algorithm in java can find the path only if it goes from top down and from left to right. I want the code to be able to check top bottom left right before deciding where to move not only bottom and right. Can you guys help me? This is my code



and this is the other class



Thanks!
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

elvis de abreu wrote:My problem is that right now my A* algorithm in java can find the path only if it goes from top down and from left to right. I want the code to be able to check top bottom left right before deciding where to move not only bottom and right. Can you guys help me? This is my code


Welcome elvis.

1. That is a fabulous amount of code.
(a) Given that our normal guideline is to compile every 10 lines and test every method, I wonder how you got this far before running into a problem.
(b) We're all volunteers here, and it's unlikely that anyone is going to want to plough through 330-odd lines of code without detailed analysis from you of what your problem is.

2. Your code lines are far too long, which makes your code (and thread) difficult to read.

A* is NOT a simple algorithm, so anything you can do to help us out is likely to get you answers much quicker.

Winston
 
elvis de abreu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry about that so the mainly problem is that



only look for for nodes in the right side and the bottom so i need to insert the node y-1 and the x- 1 so that part i am not sure how to do it because i need to modify that and



needs to be modify also so it will know when a node already been visited so it will not get into a endless loop.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic