本文整理了Java中edu.uci.ics.jung.graph.Graph.isSource()
方法的一些代码示例,展示了Graph.isSource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.isSource()
方法的具体详情如下:
包路径:edu.uci.ics.jung.graph.Graph
类名称:Graph
方法名:isSource
[英]Returns true
if vertex
is the source of edge
. Equivalent to getSource(edge).equals(vertex)
.
[中]如果vertex
是edge
的源,则返回true
。相当于getSource(edge).equals(vertex)
。
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#isSource(java.lang.Object,
* java.lang.Object)
*/
@Override
public boolean isSource(V vertex, E edge) {
return delegate.isSource(vertex, edge);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#isSource(java.lang.Object, java.lang.Object)
*/
public boolean isSource(V vertex, E edge) {
return delegate.isSource(vertex, edge);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#isSource(java.lang.Object, java.lang.Object)
*/
public boolean isSource(V vertex, E edge) {
return delegate.isSource(vertex, edge);
}
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#isSource(java.lang.Object,
* java.lang.Object)
*/
@Override
public synchronized boolean isSource(V vertex, E edge) {
return delegate.isSource(vertex, edge);
}
代码示例来源:origin: net.sf.jung/jung-visualization
public boolean isSource(V vertex, E edge) {
return graph.isSource(vertex, edge);
}
public boolean isSuccessor(V v1, V v2) {
代码示例来源:origin: geogebra/geogebra
/**
* @see edu.uci.ics.jung.graph.Graph#isSource(java.lang.Object,
* java.lang.Object)
*/
@Override
public boolean isSource(V vertex, E edge) {
return delegate.isSource(vertex, edge);
}
代码示例来源:origin: net.sf.jung/jung-api
/**
* @see edu.uci.ics.jung.graph.Graph#isSource(java.lang.Object, java.lang.Object)
*/
public synchronized boolean isSource(V vertex, E edge) {
return delegate.isSource(vertex, edge);
}
代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer
/**
* Returns <code>true</code> if the vertex is the source of the edge.
*
* @param vertex The vertex.
* @param edge The edge.
* @return <code>true</code> if the vertex is the source.
*/
public boolean isSource(Object vertex, Object edge)
{
return delegate.isSource(vertex, edge);
}
代码示例来源:origin: girtel/Net2Plan
private static <V, E> void validatePath(Graph<V, E> graph, V source, V target, List<E> path)
{
if (!graph.isSource(source, path.get(0))) throw new RuntimeException("Bad - Source node is not the first node in the path");
Iterator<E> it = path.iterator();
E originVertex = it.next();
while (it.hasNext())
{
E destinationVertex = it.next();
if (!graph.isSource(graph.getDest(originVertex), destinationVertex)) throw new RuntimeException("Bad - Path is not contiguous");
originVertex = destinationVertex;
}
if (!graph.isDest(target, path.get(path.size() - 1))) throw new RuntimeException("Bad - ");
}
代码示例来源:origin: org.opendaylight.nic/of-renderer
private List<E> restorePaths(final List<E> path, final V target, final List<E> partialMergedPaths) {
final List<E> resultPath = new ArrayList<>();
resultPath.add(path.get(0));
partialMergedPaths.remove(path.get(0));
if (!isDestination(target, resultPath)){
V currentDestination = graph.getDest(resultPath.get(resultPath.size() - 1));
for (E edge : partialMergedPaths){
if (graph.isSource(currentDestination, edge)) {
resultPath.add(edge);
partialMergedPaths.remove(edge);
break;
}
}
}
return resultPath;
}
代码示例来源:origin: girtel/Net2Plan
private List<E> recombinePaths(List<E> path, V target, List<E> union)
{
LinkedList<E> p = new LinkedList<E>(); /* provides getLast */
p.add(path.get(0));
union.remove(path.get(0));
V curDest;
while (!(curDest = graph.getDest(p.getLast())).equals(target))
{
boolean progress = false;
for (E e : union)
{
if (graph.isSource(curDest, e))
{
p.add(e);
progress = true;
union.remove(e);
break;
}
}
if (!progress) return null;
if (union.isEmpty())
{
if (!graph.isDest(target, p.getLast()))
throw new RuntimeException("Bad");
else
break;
}
}
return p;
}
代码示例来源:origin: org.opendaylight.nic/of-renderer
private void discardCommonReversedEdges(final Graph<V,E> graph, final List<E> path1, final List<E> path2) {
if (path1.size() == 0 || path2.size() == 0){
return;
} else {
final V source = graph.getSource(path1.get(0));
final V target = graph.getDest(path1.get(path1.size() - 1));
for(final E edge2 : path2){
for(final E edge1 : path1){
if (edge1.equals(edge2)){
if (graph.isSource(source, edge1) ||
graph.isSource(source, edge2) ||
graph.isDest(target, edge1) ||
graph.isDest(target, edge2)){
// Return only shortest path
path2.clear();
return;
}
path1.remove(edge1);
path2.remove(edge2);
break;
}
}
}
}
}
代码示例来源:origin: girtel/Net2Plan
if (graph.isSource(deviation, e))
代码示例来源:origin: girtel/Net2Plan
if (graph.isSource(source, e1) || graph.isSource(source, e2) || graph.isDest(target, e1) || graph.isDest(target, e2)) return null;
代码示例来源:origin: net.sf.jung/jung-algorithms
public Double apply(VEPair<V,E> ve_pair)
{
V v = ve_pair.getV();
E e = ve_pair.getE();
if (graph.getEdgeType(e) != EdgeType.DIRECTED)
throw new IllegalArgumentException("This Function only" +
" operates on directed edges");
return 1.0 / (graph.isSource(v, e) ?
graph.outDegree(v) :
graph.inDegree(v));
}
}
代码示例来源:origin: geogebra/geogebra
/**
* @see org.apache.commons.collections15.Transformer#transform(Object)
* @throws IllegalArgumentException
*/
@Override
public Double transform(VEPair<V, E> ve_pair) {
V v = ve_pair.getV();
E e = ve_pair.getE();
if (graph.getEdgeType(e) != EdgeType.DIRECTED) {
throw new IllegalArgumentException(
"This transformer only" + " operates on directed edges");
}
return 1.0 / (graph.isSource(v, e) ? graph.outDegree(v)
: graph.inDegree(v));
}
}
代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2
/**
* @see org.apache.commons.collections15.Transformer#transform(Object)
* @throws IllegalArgumentException
*/
public Double transform(VEPair<V,E> ve_pair)
{
V v = ve_pair.getV();
E e = ve_pair.getE();
if (graph.getEdgeType(e) != EdgeType.DIRECTED)
throw new IllegalArgumentException("This transformer only" +
" operates on directed edges");
return 1.0 / (graph.isSource(v, e) ?
graph.outDegree(v) :
graph.inDegree(v));
}
}
内容来源于网络,如有侵权,请联系作者删除!