本文整理汇总了Java中org.graphstream.graph.Edge.getTargetNode方法的典型用法代码示例。如果您正苦于以下问题:Java Edge.getTargetNode方法的具体用法?Java Edge.getTargetNode怎么用?Java Edge.getTargetNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.graphstream.graph.Edge
的用法示例。
在下文中一共展示了Edge.getTargetNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: weighEdges
import org.graphstream.graph.Edge; //导入方法依赖的package包/类
private void weighEdges() {
double maxCount = flowGraph.maxEdgeCount() + 1.0;
for(Edge edge : graphicGraph.getEachEdge()) {
Node from = edge.getSourceNode();
Node to = edge.getTargetNode();
int fromId = Integer.parseInt(from.toString());
int toId = Integer.parseInt(to.toString());
int count = flowGraph.getEdgeCount(fromId, toId);
double weight = (maxCount - count)/maxCount;
edge.addAttribute("layout.weight", weight);
}
}
示例2: weighEdges
import org.graphstream.graph.Edge; //导入方法依赖的package包/类
public void weighEdges() {
double maxCount = displayedGraph.maxEdgeCount() + 1.0;
for(Edge edge : graph.getEachEdge()) {
Node from = edge.getSourceNode();
Node to = edge.getTargetNode();
int fromId = Integer.parseInt(from.toString());
int toId = Integer.parseInt(to.toString());
int count = displayedGraph.getEdgeCount(fromId, toId);
double weight = (maxCount - count)/maxCount;
edge.addAttribute("layout.weight", weight);
}
}
示例3: mergeGraphEdges
import org.graphstream.graph.Edge; //导入方法依赖的package包/类
/**
* @see org.splevo.vpm.analyzer.VPMAnalyzerService#mergeGraphs(java.util.List)
*
* {@inheritDoc}
*/
@Override
public void mergeGraphEdges(VPMGraph vpmGraph) {
for (Edge edge : vpmGraph.getEachEdge()) {
Node sourceNode = edge.getSourceNode();
Node targetNode = edge.getTargetNode();
// enrich the merge edge or create a new one
String edgeId = buildEdgeId(sourceNode, targetNode);
Edge mergeEdge = vpmGraph.getEdge(edgeId);
if (mergeEdge == null) {
mergeEdge = vpmGraph.addEdge(edgeId, sourceNode, targetNode);
for (String key : edge.getAttributeKeySet()) {
mergeEdge.addAttribute(key, edge.getAttribute(key));
}
} else {
RelationshipEdge relEdge = (RelationshipEdge) edge;
RelationshipEdge relMergeEdge = (RelationshipEdge) mergeEdge;
relMergeEdge.getRelationshipInfos().addAll(relEdge.getRelationshipInfos());
relMergeEdge.getRelationshipLabels().addAll(relEdge.getRelationshipLabels());
}
// remove the old merged node
vpmGraph.removeEdge(edge);
}
}