当前位置: 首页>>代码示例>>Java>>正文


Java Edge.getTargetNode方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:spideruci,项目名称:cerebro-layout,代码行数:13,代码来源:Spine.java

示例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);
	}
}
 
开发者ID:spideruci,项目名称:cerebro-layout,代码行数:13,代码来源:DynamicDisplay.java

示例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);
    }
}
 
开发者ID:kopl,项目名称:SPLevo,代码行数:33,代码来源:DefaultVPMAnalyzerService.java


注:本文中的org.graphstream.graph.Edge.getTargetNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。