bin/ai/regression/regression.nut
branchnoai
changeset 10944 588393239ac6
parent 10938 df6235dd2b7a
child 10952 d16212cc2394
equal deleted inserted replaced
10943:5f5a5dd407d8 10944:588393239ac6
     1 import("queue.priority_queue", "PQ", 2);
     1 import("queue.priority_queue", "PQ", 2);
     2 import("queue.binary_heap", "BH", 1);
     2 import("queue.binary_heap", "BH", 1);
     3 import("graph.aystar", "AS", 3);
     3 import("graph.aystar", "AS", 3);
       
     4 import("pathfinder.road", "RPF", 1);
     4 
     5 
     5 class Regression extends AIController {
     6 class Regression extends AIController {
     6 	function Start();
     7 	function Start();
     7 }
     8 }
     8 
     9 
   723 	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
   724 	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
   724 		print("    " + i + " => " + list.GetValue(i));
   725 		print("    " + i + " => " + list.GetValue(i));
   725 	}
   726 	}
   726 }
   727 }
   727 
   728 
       
   729 function Regression::Pathfinder()
       
   730 {
       
   731 	print("");
       
   732 	print("--PathFinder--");
       
   733 	print("  Road Between Towns:");
       
   734 
       
   735 	local pathfinder = RPF();
       
   736 
       
   737 	local path = false;
       
   738 	pathfinder.InitializePath([AITown.GetLocation(0)], [AITown.GetLocation(1)])
       
   739 	while (path == false) path = pathfinder.FindPath(1000);
       
   740 
       
   741 	while (path != null) {
       
   742 		print("    Tile " + path.GetNode());
       
   743 		path = path.GetParent();
       
   744 	}
       
   745 }
       
   746 
   728 function Regression::QueueTest(queue)
   747 function Regression::QueueTest(queue)
   729 {
   748 {
   730 	print("  Count(): " + queue.Count());
   749 	print("  Count(): " + queue.Count());
   731 	print("  Peek():  " + queue.Peek());
   750 	print("  Peek():  " + queue.Peek());
   732 	print("  Pop():   " + queue.Pop());
   751 	print("  Pop():   " + queue.Pop());
  1354 	this.Graph();
  1373 	this.Graph();
  1355 	this.Industry();
  1374 	this.Industry();
  1356 	this.IndustryList();
  1375 	this.IndustryList();
  1357 	this.Map();
  1376 	this.Map();
  1358 	this.Marine();
  1377 	this.Marine();
       
  1378 	this.Pathfinder();
  1359 	this.Queues();
  1379 	this.Queues();
  1360 	this.Road();
  1380 	this.Road();
  1361 	this.Sign();
  1381 	this.Sign();
  1362 	this.Station();
  1382 	this.Station();
  1363 	this.TileList();
  1383 	this.TileList();