if (!visited.contains(current)) queue.add(current);
if (!visited.contains(current)) {  Iterator sources = current.getHead().getSourceSet().iterator(); boolean addMe = true; while (sources.hasNext()) { if (!visited.contains(((Edge)sources.next()).getSrc().getParent())) { addMe = false; break; } } if (addMe) queue.add(current); }
    public static LinkedList getInitSchedule(Trace[] topTraces)     {	//BFS	LinkedList schedule = new LinkedList();	HashSet visited = new HashSet();	LinkedList queue = new LinkedList();	for (int i = 0; i < topTraces.length; i++) {	    queue.add(topTraces[i]);	    while (!queue.isEmpty()) {		Trace trace = (Trace)queue.removeFirst();		if (!visited.contains(trace)) {		    visited.add(trace);		    Iterator dests = trace.getTail().getDestSet().iterator();		    while (dests.hasNext()) {			Trace current = ((Edge)dests.next()).getDest().getParent();			if (!visited.contains(current))			    queue.add(current);		    }		    if (!trace.getHead().getNextFilter().isPredefined()) {			System.out.println("Adding " + trace + " to init schedule.");		    			schedule.add(trace);		    }		}	    }	}		return schedule;    }