@Test public void testInterconnectSmallDepth() { final Kam kam = createTestKAM(); final PathFinder pathFinder = new BasicPathFinder(kam, 3); SimplePath[] pathsFound = pathFinder.interconnect(new KamNode[] { kam.findNode("proteinAbundance(23)"), kam.findNode("proteinAbundance(28)") }); assertNotNull(pathsFound); assertEquals(0, pathsFound.length); }
@Override public SimplePath[] interconnect(KamNode[] sources) { if (sources == null || sources.length < 2) { throw new InvalidArgument( "Source kam nodes cannot be null and must contain at least two source nodes."); } final Set<KamNode> targetSet = new HashSet<KamNode>(sources.length); for (int i = 0; i < sources.length; i++) { final KamNode source = sources[i]; if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } targetSet.add(source); } final List<SimplePath> pathsFound = new ArrayList<SimplePath>(); for (final KamNode source : sources) { targetSet.remove(source); pathsFound.addAll(runDepthFirstSearch(kam, source, targetSet)); } return pathsFound.toArray(new SimplePath[pathsFound.size()]); }
BasicPathFinder implements PathFinder { @Override public SimplePath[] interconnect(KamNode[] sources) { if (sources == null || sources.length < 2) { throw new InvalidArgument( "Source kam nodes cannot be null and must contain at least two source nodes."); } final Set<KamNode> targetSet = new HashSet<KamNode>(sources.length); for (int i = 0; i < sources.length; i++) { final KamNode source = sources[i]; if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } targetSet.add(source); } final List<SimplePath> pathsFound = new ArrayList<SimplePath>(); for (final KamNode source : sources) { targetSet.remove(source); pathsFound.addAll(runDepthFirstSearch(kam, source, targetSet)); } return pathsFound.toArray(new SimplePath[pathsFound.size()]); } }
BasicPathFinder implements PathFinder { @Override public SimplePath[] interconnect(KamNode[] sources) { if (sources == null || sources.length < 2) { throw new InvalidArgument( "Source kam nodes cannot be null and must contain at least two source nodes."); } final Set<KamNode> targetSet = new HashSet<KamNode>(sources.length); for (int i = 0; i < sources.length; i++) { final KamNode source = sources[i]; if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } targetSet.add(source); } final List<SimplePath> pathsFound = new ArrayList<SimplePath>(); for (final KamNode source : sources) { targetSet.remove(source); pathsFound.addAll(runDepthFirstSearch(kam, source, targetSet)); } return pathsFound.toArray(new SimplePath[pathsFound.size()]); } BasicPathFinder(final Kam kam);  BasicPathFinder(final Kam kam, final int maxSearchDepth); }
BasicPathFinder implements PathFinder { @Override public SimplePath[] interconnect(KamNode[] sources) { if (sources == null || sources.length < 2) { throw new InvalidArgument( "Source kam nodes cannot be null and must contain at least two source nodes."); } final Set<KamNode> targetSet = new HashSet<KamNode>(sources.length); for (int i = 0; i < sources.length; i++) { final KamNode source = sources[i]; if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } targetSet.add(source); } final List<SimplePath> pathsFound = new ArrayList<SimplePath>(); for (final KamNode source : sources) { targetSet.remove(source); pathsFound.addAll(runDepthFirstSearch(kam, source, targetSet)); } return pathsFound.toArray(new SimplePath[pathsFound.size()]); } BasicPathFinder(final Kam kam);  BasicPathFinder(final Kam kam, final int maxSearchDepth); @Override SimplePath[] findPaths(KamNode source, KamNode target); @Override SimplePath[] findPaths(KamNode[] sources, KamNode[] targets); @Override SimplePath[] interconnect(KamNode[] sources); @Override SimplePath[] scan(KamNode source); @Override SimplePath[] scan(KamNode[] sources); }
BasicPathFinder implements PathFinder { @Override public SimplePath[] interconnect(KamNode[] sources) { if (sources == null || sources.length < 2) { throw new InvalidArgument( "Source kam nodes cannot be null and must contain at least two source nodes."); } final Set<KamNode> targetSet = new HashSet<KamNode>(sources.length); for (int i = 0; i < sources.length; i++) { final KamNode source = sources[i]; if (!kam.contains(source)) { throw new InvalidArgument("Source does not exist in KAM."); } targetSet.add(source); } final List<SimplePath> pathsFound = new ArrayList<SimplePath>(); for (final KamNode source : sources) { targetSet.remove(source); pathsFound.addAll(runDepthFirstSearch(kam, source, targetSet)); } return pathsFound.toArray(new SimplePath[pathsFound.size()]); } BasicPathFinder(final Kam kam);  BasicPathFinder(final Kam kam, final int maxSearchDepth); @Override SimplePath[] findPaths(KamNode source, KamNode target); @Override SimplePath[] findPaths(KamNode[] sources, KamNode[] targets); @Override SimplePath[] interconnect(KamNode[] sources); @Override SimplePath[] scan(KamNode source); @Override SimplePath[] scan(KamNode[] sources); final static int DEFAULT_MAX_SEARCH_DEPTH; }