summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-17 15:53:57 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-17 15:53:57 +0200
commit580018e419c1c0d6cdc4f47103be2d7c1aad1eb7 (patch)
tree102792a4a618b7ffdcc135450641c1f2a1825396 /cfg-to-paths/src/Path.java
parentd48380bd87dcef4b095b2a4e578d4461e68df73c (diff)
Fixes a few dumb mistakes, adds ps example.
Diffstat (limited to 'cfg-to-paths/src/Path.java')
-rw-r--r--cfg-to-paths/src/Path.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/cfg-to-paths/src/Path.java b/cfg-to-paths/src/Path.java
index 80b433f..76ba28a 100644
--- a/cfg-to-paths/src/Path.java
+++ b/cfg-to-paths/src/Path.java
@@ -31,6 +31,21 @@ public class Path
{
final Collection<Path> result;
final Stack<Path> waiting_list;
+ final Node root_node;
+
+ root_node = Node.get_node(root);
+
+ if (root_node == null)
+ {
+ System.err.println
+ (
+ "[E] Could not find root node \""
+ + root
+ + "\"."
+ );
+
+ return null;
+ }
result = new ArrayList<Path>();
waiting_list = new Stack<Path>();
@@ -63,17 +78,17 @@ public class Path
return result;
}
- public static Collection<List<Node>> get_subpaths (final Path p)
+ public Collection<List<Node>> get_all_subpaths ()
{
final Collection<List<Node>> result;
final int path_length;
result = new ArrayList<List<Node>>();
- path_length = p.nodes.size();
+ path_length = nodes.size();
for (int i = 0; i < path_length; ++i)
{
- result.add(p.nodes.subList(i, path_length));
+ result.add(nodes.subList(i, path_length));
}
return result;