Map<CmpVertex,DeterministicVertex> oldToNew = new HashMapWithSearch<CmpVertex,DeterministicVertex>(coregraph.getStateNumber());
// add states
for(Entry<CmpVertex,Map<CmpVertex,Set<Label>>> entry:flowgraph.entrySet())
{
CmpVertex source = entry.getKey();
DeterministicVertex vert = new DeterministicVertex(source);
if (coregraph.getInit() == source)
vert.addUserDatum(JUConstants.INITIAL, true, UserData.SHARED);
vert.setAccept(source.isAccept());
vert.setColour(source.getColour());
vert.setHighlight(source.isHighlight());
result.addVertex(vert);
oldToNew.put(source,vert);
}
// now add transitions
for(Entry<CmpVertex,Map<CmpVertex,Set<Label>>> entry:flowgraph.entrySet())
{
DeterministicVertex source = oldToNew.get(entry.getKey());
for(Entry<CmpVertex,Set<Label>> tgtEntry:entry.getValue().entrySet())
{
DeterministicVertex target = oldToNew.get(tgtEntry.getKey());
DeterministicEdge e = new DeterministicEdge(source,target);
e.addUserDatum(JUConstants.LABEL, tgtEntry.getValue(), UserData.CLONE);
result.addEdge(e);
}
}