Skip to content

Commit

Permalink
Parser: fixed bug with node's name generation
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoxmed committed Oct 30, 2017
1 parent 5dbd574 commit 48999e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fr/tpt/s3/ls_mxc/parser/MCParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void readXML () {
Node n = nList.item(i);
if (n.getNodeType() == Node.ELEMENT_NODE) {
Element e = (Element) n;
Actor a = new Actor(nb_actors++, e.getAttribute("name"),
Actor a = new Actor(nb_actors++, "D"+d+"N"+e.getAttribute("name"),
Integer.parseInt(e.getElementsByTagName("clo").item(0).getTextContent()),
Integer.parseInt(e.getElementsByTagName("chi").item(0).getTextContent()));
a.setfProb(Double.parseDouble(e.getElementsByTagName("fprob").item(0).getTextContent()));
Expand Down Expand Up @@ -157,8 +157,8 @@ public void readXML () {
Element e = (Element) n;
// Creating the edge adds it to the corresponding nodes
@SuppressWarnings("unused")
Edge ed = new Edge(dag.getNodebyName(e.getAttribute("srcActor")),
dag.getNodebyName(e.getAttribute("dstActor")));
Edge ed = new Edge(dag.getNodebyName("D"+d+"N"+e.getAttribute("srcActor")),
dag.getNodebyName("D"+d+"N"+e.getAttribute("dstActor")));
}
}
dag.sanityChecks();
Expand Down

0 comments on commit 48999e2

Please sign in to comment.