--- a/bin/ai/library/graph/aystar/main.nut Thu Jun 12 18:14:06 2008 +0000
+++ b/bin/ai/library/graph/aystar/main.nut Thu Jun 12 19:47:02 2008 +0000
@@ -1,14 +1,12 @@
/* $Id$ */
-/* We need a Queue */
-import("queue.binary_heap", "Queue", 1);
-
/**
* An AyStar implementation.
* It solves graphs by finding the fastest route from one point to the other.
*/
class AyStar
{
+ _queue_class = import("queue.binary_heap", "", 1);
_cost_callback = null;
_estimate_callback = null;
_neighbours_callback = null;
@@ -85,7 +83,7 @@
if (typeof(sources) != "array" || sources.len() == 0) throw("sources has be a non-empty array.");
if (typeof(goals) != "array" || goals.len() == 0) throw("goals has be a non-empty array.");
- this._open = Queue();
+ this._open = this._queue_class();
this._closed = AIList();
foreach (node in sources) {