currentPath.clear();
    public LinkedList explore() {	currentPath = new ExplorerList();	bestPath = new LinkedList();	bestCost = maxCost;		/* "Stupidity" filter... */	if (start.equals(target))	    return currentPath;	PathExplorer pe = startExplorer;	Point currentPos = new Point();	exploredTiles.clear();	currentPath.clear();	do {	    exploredTiles.add(new Point(pe.getX(), pe.getY()));	    currentPath.add(pe);	    pe = pe.exploreNewTile();	    if (pe == null) {		if (currentPath.size() == 0) {		    // we have already explored all tiles		    break;		} else {		    // remove the current tile, and continue searching with		    // the previous tile.		    currentPath.removeLast();		    pe = (PathExplorer) currentPath.removeLast();		    continue;		}	    }	    /* Is this tile already explored?	     * Have we explored further than our maxCost? */	    currentPos.setLocation(pe.getX(), pe.getY());	    if (exploredTiles.contains(currentPos) ||		    currentPath.getCost() > maxCost) {		/* go back to old tile */		pe = (PathExplorer) currentPath.removeLast();		continue;	    }	    /* have we doubled back on ourselves ? */	    Iterator i = currentPath.iterator();	    do {		PathExplorer p = (PathExplorer) i.next();		if (currentPos.x == p.getX() &&			currentPos.y == p.getY()) {		    pe = (PathExplorer) currentPath.removeLast();		    break;		}	    } while (i.hasNext());	    /* have we reached the target ? */	    if (currentPos.equals(target)) {		i = currentPath.iterator();		int cost = 0;		do {		    cost += ((PathExplorer) i.next()).getCost();		} while (i.hasNext());		if (cost < bestCost) {		    /* this is the new best route */		    bestCost = cost;		    bestPath.clear();		    i = currentPath.iterator();		    do {			bestPath.add(((PathExplorer) i.next()).getCopy());		    } while (i.hasNext());		}	    }	} while (bestCost > minCost);	return bestPath;    }