Permalink
Browse files

Tried making sure dijkstra's would work

  • Loading branch information...
1 parent 8a6b938 commit 751eb5bacebb348ccd48050b421e77418d52c1da @thenoviceoof thenoviceoof committed Nov 21, 2011
Showing with 81 additions and 7 deletions.
  1. +2 −0 hw4_start_goal.txt
  2. +69 −0 hw4_world_obstacles.txt
  3. +9 −7 src/robot/PathPlanner.java
  4. +1 −0 src/robot/Point.java
View
@@ -0,0 +1,2 @@
+-3.107 0.58
+10.657 -0.03
View
@@ -0,0 +1,69 @@
+10
+16
+7.734 1.458
+7.787 3.694
+-2.306 2.498
+-2.216 2.238
+-2.217 1.445
+-3.620 1.428
+-3.618 -3.690
+0.979 -3.686
+1.966 -3.240
+3.631 -2.620
+3.379 -1.891
+3.382 -1.141
+4.454 -1.139
+4.440 -0.914
+11.116 -0.916
+11.109 1.457
+6
+-2.244320 -0.040632
+-2.244320 -0.510632
+-1.774320 -0.510632
+-1.769570 0.299269
+-2.099570 0.299269
+-2.099570 -0.030731
+6
+4.859620 1.190210
+4.859620 0.720210
+5.329620 0.720210
+5.304260 1.528800
+4.974260 1.528800
+4.974260 1.198800
+6
+2.239030 -0.773950
+1.769030 -0.773950
+1.769030 -1.243950
+2.578530 -1.247780
+2.578530 -0.917780
+2.248530 -0.917780
+4
+5.329590 0.437658
+4.859590 0.437658
+4.859590 -0.032342
+5.329590 -0.032342
+4
+1.772600 -0.036179
+1.302600 -0.036179
+1.302600 -0.506179
+1.772600 -0.506179
+4
+0.467089 0.439399
+-0.002911 0.439399
+-0.002911 -0.030601
+0.467089 -0.030601
+4
+-1.772780 1.188248
+-2.242780 1.188248
+-2.242780 0.718248
+-1.772780 0.718248
+4
+1.058185 0.294929
+0.728185 0.294929
+0.728185 -0.035071
+1.058185 -0.035071
+4
+8.877310 -0.574018
+8.547310 -0.574018
+8.547310 -0.904018
+8.877310 -0.904018
View
@@ -55,17 +55,19 @@
private ArrayList<Point> possibleNextPoints(Point current, Map map)
{
- //to be implemented
- return new ArrayList<Point>();
+ // gets all the points, except the immediate predecessor
+ ArrayList<Point> next = new ArrayList<Point>();
+ for(int i = 0; i < map.nodes.size(); i++)
+ {
+ if(map.nodes.get(i) != current.path)
+ next.add(map.nodes.get(i));
+ }
+ return next;
}
public static void main(String [] args) {
// fast test
- Polygon pp = new Polygon(4);
- pp.add(new Point(-1,-1));
- pp.add(new Point(-1,1));
- pp.add(new Point(1,1));
- pp.add(new Point(1,-1));
+
// open the map
// Map map = new Map(args[0]);
View
@@ -4,6 +4,7 @@
{
public double x;
public double y;
+ // below is mostly for the path finding algorithms
public double dist = Double.MAX_VALUE;
public boolean known = false;
public Point path = null;//previous node in path

0 comments on commit 751eb5b

Please sign in to comment.