diff --git a/src/main/java/org/fujaba/graphengine/PatternEngine.java b/src/main/java/org/fujaba/graphengine/PatternEngine.java index 904761c..4937315 100644 --- a/src/main/java/org/fujaba/graphengine/PatternEngine.java +++ b/src/main/java/org/fujaba/graphengine/PatternEngine.java @@ -1318,7 +1318,7 @@ public static boolean evaluate(Evaluator evaluator, String expression) { } toParse = toParse.substring(toParse.indexOf(searchFor) + searchFor.length()); toParse = toParse.substring(0, toParse.length() - 2); - evaluator.putVariable(toParse, "0.0"); + evaluator.putVariable(toParse, "0"); } } while (catched == true); return matched; diff --git a/src/test/java/org/fujaba/graphengine/unitTests/TestLoadingTTCStateCaseData.java b/src/test/java/org/fujaba/graphengine/unitTests/TestLoadingTTCStateCaseData.java index efd4860..3d4d169 100644 --- a/src/test/java/org/fujaba/graphengine/unitTests/TestLoadingTTCStateCaseData.java +++ b/src/test/java/org/fujaba/graphengine/unitTests/TestLoadingTTCStateCaseData.java @@ -143,6 +143,14 @@ public void testTransformingTTCStateCaseData() { } System.out.println("after joining multiple labels with the same sources and same targets:\n" + g + "\n"); + + + + /** + * TODO: really just randomly find a 'k' and then find all matching 'p's and 'q's for it, to work with them in a 'batch' + */ + + // gtr for state elimination itself (the q->k->p to q->p case) PatternGraph gtrEliminate = new PatternGraph("eliminate state"); PatternNode p = new PatternNode(); @@ -151,7 +159,6 @@ public void testTransformingTTCStateCaseData() { gtrEliminate.addPatternNode(p, k, q); p.addPatternEdge("==", (String)null, k); k.addPatternEdge("==", (String)null, q); - k.addPatternEdge("!=", "this_is_no_real_edge", q); do { matches = PatternEngine.matchPattern(g, gtrEliminate, true); @@ -169,7 +176,7 @@ public void testTransformingTTCStateCaseData() { } } Boolean pqb = false; - if (pqLabel != null && pqLabel != "" && pqLabel != "this_is_no_real_edge") { + if (pqLabel != null && pqLabel != "") { pqb = true; } // System.out.println(" pqLabel: " + pqLabel); @@ -187,7 +194,7 @@ public void testTransformingTTCStateCaseData() { } } Boolean kkb = false; - if (kkLabel != null && kkLabel != "" && kkLabel != "this_is_no_real_edge") { + if (kkLabel != null && kkLabel != "") { kkb = true; } // System.out.println(" kkLabel: " + kkLabel);