}
}
- //clean the graph to remove doubles due to reinjection of non totally processed fses in the fifo
- graph = clean(graph);
}
}
//link to the parent.
if (graph.containsKey(key2)){
target = (EGTaskNode)graph.get(key2);
- TEdge newedge=new TEdge(target);
+ EGEdge newedge=new EGEdge(target);
tn.addEdge(newedge);
}
else {
- TEdge newedge=new TEdge(target);
+ EGEdge newedge=new EGEdge(target);
tn.addEdge(newedge);
}
//put child in graph
}
if (graph.containsKey(key2)){
target = (EGTaskNode)graph.get(key2);
- TEdge newedge=new TEdge(target);
+ EGEdge newedge=new EGEdge(target);
tn.addEdge(newedge);
}
else {
- TEdge newedge=new TEdge(target);
+ EGEdge newedge=new EGEdge(target);
tn.addEdge(newedge);
}
graph.put(key2, target);
}
}
- //removes the duplicated edges
- private Hashtable clean(Hashtable ht){
- Hashtable cleaned = new Hashtable();
- Collection c = ht.values();
- for ( Iterator it = c.iterator(); it.hasNext();){
- EGTaskNode tn = (EGTaskNode)it.next();
- Vector v = tn.getEdgeVector();
- v = removeDouble(v);
- tn.removeAllEdges();
- tn.addEdge(v);
- cleaned.put(tn.getuid(), tn);
- }
- return cleaned;
- }
-
- //removes all the edge doubles in vector v
- private Vector removeDouble(Vector v){
-
- Vector vcleaned = new Vector();
- for (Iterator it = v.iterator(); it.hasNext();){
-
- TEdge edge = (TEdge)it.next();
- int contains = 0;
- for (Iterator it2 = vcleaned.iterator(); it2.hasNext();){
- if (((EGTaskNode)edge.getTarget()).getuid()==((EGTaskNode)((TEdge)it2.next()).getTarget()).getuid()) contains = 1;
- }
-
- if (contains == 0) vcleaned.add(edge);
- }
-
- return vcleaned;
- }
-
//test if a flagstate has been entirely processed
private boolean isFinished(FlagState fs){
for(Iterator it2 = tn.edges();it2.hasNext();){
- output.println("\t"+tn.getLabel()+" -> "+((EGTaskNode)((TEdge)it2.next()).getTarget()).getLabel()+";");
+ output.println("\t"+tn.getLabel()+" -> "+((EGTaskNode)((EGEdge)it2.next()).getTarget()).getLabel()+";");
}
}
}