bin/ai/regression/regression.nut
branchnoai
changeset 10944 588393239ac6
parent 10938 df6235dd2b7a
child 10952 d16212cc2394
--- a/bin/ai/regression/regression.nut	Thu Jun 12 21:07:25 2008 +0000
+++ b/bin/ai/regression/regression.nut	Thu Jun 12 21:18:09 2008 +0000
@@ -1,6 +1,7 @@
 import("queue.priority_queue", "PQ", 2);
 import("queue.binary_heap", "BH", 1);
 import("graph.aystar", "AS", 3);
+import("pathfinder.road", "RPF", 1);
 
 class Regression extends AIController {
 	function Start();
@@ -725,6 +726,24 @@
 	}
 }
 
+function Regression::Pathfinder()
+{
+	print("");
+	print("--PathFinder--");
+	print("  Road Between Towns:");
+
+	local pathfinder = RPF();
+
+	local path = false;
+	pathfinder.InitializePath([AITown.GetLocation(0)], [AITown.GetLocation(1)])
+	while (path == false) path = pathfinder.FindPath(1000);
+
+	while (path != null) {
+		print("    Tile " + path.GetNode());
+		path = path.GetParent();
+	}
+}
+
 function Regression::QueueTest(queue)
 {
 	print("  Count(): " + queue.Count());
@@ -1356,6 +1375,7 @@
 	this.IndustryList();
 	this.Map();
 	this.Marine();
+	this.Pathfinder();
 	this.Queues();
 	this.Road();
 	this.Sign();