Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diag = false do not return any Points #3

Open
GoogleCodeExporter opened this issue Jan 27, 2016 · 2 comments
Open

diag = false do not return any Points #3

GoogleCodeExporter opened this issue Jan 27, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. The code I have provided do not return any Points.
2.
3.

What is the expected output? What do you see instead?
An array with non diagonal points / An empty Array.

What version of the product are you using? On what operating system?
1.2 / W7

Please provide any additional information below.
First thing first. Great job with Dijkstra's algorithm!
Well, maybe I have misunderstood something here but I need to get the 
Points/steps between A & B. When I pass in "diag = true" it seems to work, but 
when I pass in false the getPath() function do not return any points. Any 
suggestions? Thanks!


var map:Array = [[0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0],
         [0, 0, 1, 1, 0, 0, 0, 0, 0, 0]];

var pt:Pathfinder = new Pathfinder();           
pt.loadMap(map, 10, 10);
var path:Array = pt.getPath(new Point(1, 1), new Point(8, 8), false);    


Original issue reported on code.google.com by ralf.him...@gmail.com on 20 Oct 2011 at 3:29

@GoogleCodeExporter
Copy link
Author

Just uploaded version 1.3 should work with your example... pretty strange there 
was a bug that I never saw before.... Thanks!

Original comment by avetis.z...@gmail.com on 23 Dec 2011 at 10:24

@GoogleCodeExporter
Copy link
Author

I am using the above example, it works
except for if i change this line

var path:Array = pt.getPath(new Point(1, 1), new Point(8, 8), false);
to
var path:Array = pt.getPath(new Point(0, 0), new Point(9, 9), false);

I want to get the path from one corner to the other, it returns
"TypeError: Error #1010: A term is undefined and has no properties.
    at Pathfinder/getPathArray()
    at Pathfinder/getPath()"

Which is 'if (i < dimensionX && tmpMap[i + 1][j] == iteration)'

The tmpMap[i + 1][j] is empty, it applies to most if functions in the 
getpatharray because with some paths, tiles next to the destination are 
non-existant, is there a quick fix for this?

Thank you

Original comment by crisyfal...@gmail.com on 1 Jan 2015 at 10:31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant