hiho,
vielleicht find n mod nen besseren Titel ^^
ich glaub ich kapier grad gar nix mehr. Ich habe folgenden Code:
nun die Ausgabe!
Die Matrixeinträge sind auch korrekt, überall ne 0 wo eine sein soll, die Auswertung der "isValidEdge" ist korrekt.
vielleicht find n mod nen besseren Titel ^^
ich glaub ich kapier grad gar nix mehr. Ich habe folgenden Code:
Java:
protected boolean isValidEdge(Vertex<T> v, Vertex<T> w) {
if (adjacencyMatrix.get(vertices.indexOf(v)).get(vertices.indexOf(w)).intValue() == 0) {
System.out.println("valid");
return true;
}
return false;
}//isValidEdge
//und folgenden kleinen Test in einer andere Methode genau in er Abfolge
//kein weitere Code dazwischen
System.out.println("VALID_EDGE?: " + isValidEdge(v, w));
System.out.println("NOT (V EQUALS W)?: " + (! v.equals(w)));
System.out.println("COMBINED: " + ((! v.equals(w)) && (isValidEdge(v,w))));
if ((! v.equals(w)) && (isValidEdge(v,w))) {
//mach was tolles
} else {
throw new GraphStructureException("Inserting directed edge will create a cycle.\n" +
v + " TO " + w);
}
nun die Ausgabe!
Code:
[COLOR="#ff0000"]valid
VALID_EDGE?: false[/COLOR] .. wie kann das sein?!
NOT (V EQUALS W)?: true
valid
COMBINED: false
valid
[COLOR="Red"]INTERNAL ERROR while copying CNF-graph structure to the syntax tree
gfeBackend.util.graph.exception.GraphStructureException: Inserting directed edge will create a cycle.
1,5 ; [ctl_formula] TO 2,1 ; [(]
at gfeBackend.util.graph.DefaultDirectedAcyclicGraph.addDirectedEdge(DefaultDirectedAcyclicGraph.java:93)
at gfeBackend.util.graph.DefaultTree.addDirectedEdge(DefaultTree.java:42)
at gfeBackend.parser.cyk.CYKParser.getBNFBasedSyntaxTree(CYKParser.java:394)
at gfeBackend.parser.cyk.CYKParser.parse(CYKParser.java:178)
at gfeBackend.GfeAccessor.parseFormula(GfeAccessor.java:389)
at gfeBackend.Test.main(Test.java:31)[/COLOR]
Die Matrixeinträge sind auch korrekt, überall ne 0 wo eine sein soll, die Auswertung der "isValidEdge" ist korrekt.
Zuletzt bearbeitet: