public Set<ProcessEdge> outgoingEdgesOf( Process vertex ) { return graph.outgoingEdgesOf( vertex ); }
/** * */ @Override public Set<Equivalences<T>> getDirectSuper(Equivalences<T> v) { Set<Equivalences<T>> result = new LinkedHashSet<>(); for (DefaultEdge edge : dag.outgoingEdgesOf(v)) { Equivalences<T> source = dag.getEdgeTarget(edge); result.add(source); } return Collections.unmodifiableSet(result); }
/** * */ @Override public Set<Equivalences<T>> getDirectSuper(Equivalences<T> v) { Set<Equivalences<T>> result = new LinkedHashSet<>(); for (DefaultEdge edge : dag.outgoingEdgesOf(v)) { Equivalences<T> source = dag.getEdgeTarget(edge); result.add(source); } return Collections.unmodifiableSet(result); }
protected Collection<ProcessFactory> getSourceDependenciesOn( Resource sourceResource ) { initResourceGraph(); Set<ProcessFactory> factories = new HashSet<ProcessFactory>(); Set<ProcessFactoryHolder> outgoing = resourceGraph.outgoingEdgesOf( sourceResource ); for( ProcessFactoryHolder processFactoryHolder : outgoing ) factories.add( processFactoryHolder.processFactory ); return factories; }
try edges = graph.outgoingEdgesOf( vertex );
try edges = graph.outgoingEdgesOf( v );
newEdgeTargets.clear(); for (E v1OutEdge : graph.outgoingEdgesOf(v1)) { V v2 = graph.getEdgeTarget(v1OutEdge); for (E v2OutEdge : graph.outgoingEdgesOf(v2)) { V v3 = graph.getEdgeTarget(v2OutEdge);
try edges = graph.outgoingEdgesOf( v );
final Set< DefaultEdge > outgoingEdges = branchGraph.outgoingEdgesOf( branch ); final Set< List< Spot >> successors = new HashSet<>( outgoingEdges.size() ); for ( final DefaultEdge edge : outgoingEdges )
final Set< DefaultEdge > outgoingEdges = branchGraph.outgoingEdgesOf( branch ); final Set< List< Spot >> successors = new HashSet<>( outgoingEdges.size() ); for ( final DefaultEdge edge : outgoingEdges )
protected void checkOrgGraph() throws SchemaException { OperationResult result = new OperationResult("temp"); int numberOfOrgsInRepo = repositoryService.countObjects(OrgType.class, null, null, result); info("Checking graph with repo. Orgs in repo: " + numberOfOrgsInRepo + ", orgs in graph: " + orgGraph.vertexSet().size()); assertTrue("# of orgs in repo (" + numberOfOrgsInRepo + ") is different from # of orgs in graph (" + orgGraph.vertexSet().size() + ")", numberOfOrgsInRepo == orgGraph.vertexSet().size()); for (String oid : orgGraph.vertexSet()) { //info("Checking " + oid); OrgType orgType; try { orgType = repositoryService.getObject(OrgType.class, oid, null, result).asObjectable(); } catch (ObjectNotFoundException|SchemaException e) { throw new AssertionError("Couldn't fetch " + oid, e); } assertTrue(orgGraph.vertexSet().contains(orgType.getOid())); Set<String> parentOidsInRepo = new HashSet<>(); for (ObjectReferenceType ort : orgType.getParentOrgRef()) { if (orgGraph.vertexSet().contains(ort.getOid())) { // i.e. the parent does exist parentOidsInRepo.add(ort.getOid()); } } Set<String> parentOidsInGraph = new HashSet<>(); for (DefaultEdge edge : orgGraph.outgoingEdgesOf(oid)) { parentOidsInGraph.add(orgGraph.getEdgeTarget(edge)); } assertEquals("Unexpected parentRefOrg set in " + orgType, parentOidsInGraph, parentOidsInRepo); } info("Graph is OK w.r.t. repo"); }
/** * Constructor for the NamedDAG * @param dag the DAG from which we want to keep only the named descriptions */ public static <T> SimpleDirectedGraph <T,DefaultEdge> getNamedDAG(EquivalencesDAG<T> dag) { SimpleDirectedGraph<T,DefaultEdge> namedDAG = new SimpleDirectedGraph<>(DefaultEdge.class); for (Equivalences<T> v : dag) namedDAG.addVertex(v.getRepresentative()); for (Equivalences<T> s : dag) for (Equivalences<T> t : dag.getDirectSuper(s)) namedDAG.addEdge(s.getRepresentative(), t.getRepresentative()); for (Equivalences<T> v : dag) if (!v.isIndexed()) { // eliminate node for (DefaultEdge incEdge : namedDAG.incomingEdgesOf(v.getRepresentative())) { T source = namedDAG.getEdgeSource(incEdge); for (DefaultEdge outEdge : namedDAG.outgoingEdgesOf(v.getRepresentative())) { T target = namedDAG.getEdgeTarget(outEdge); namedDAG.addEdge(source, target); } } namedDAG.removeVertex(v.getRepresentative()); // removes all adjacent edges as well } return namedDAG; }