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


Java Edge.getAttribute方法代码示例

本文整理汇总了Java中org.graphstream.graph.Edge.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java Edge.getAttribute方法的具体用法?Java Edge.getAttribute怎么用?Java Edge.getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.graphstream.graph.Edge的用法示例。


在下文中一共展示了Edge.getAttribute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkSTCproperty

import org.graphstream.graph.Edge; //导入方法依赖的package包/类
private boolean checkSTCproperty(Node n,List<Node> neighborsOnI) {

		for(Node u:neighborsOnI)
		{
			for(Node v: neighborsOnI)
			{
				Edge e1 = u.getEdgeBetween(v);
				Edge e2 = n.getEdgeBetween(v);
				Edge e3 = n.getEdgeBetween(u);
				if(u!=v && e1==null && ((boolean)e2.getAttribute("stc") && (boolean)e3.getAttribute("stc")))
				{
					return false;
				}
			}
		}
		return true;
	}
 
开发者ID:isislab-unisa,项目名称:streaminggraphpartitioning,代码行数:18,代码来源:AbstractSTCHeuristic.java

示例2: labelAdjacentEdges

import org.graphstream.graph.Edge; //导入方法依赖的package包/类
/**
 * labels adjacent edges of the given node 
 * @param n - node to label adjacent edges of
 */
private void labelAdjacentEdges(Node n)
{
	for (Edge e : n.getEdgeSet()){
		String _ui_label = e.getAttribute("_ui.label");
		String ui_label = e.getAttribute("ui.label"); 

		if (ui_label==null || ui_label.equals(""))
		{
			e.setAttribute("ui.label", _ui_label);

		}
	}
}
 
开发者ID:TeamCohen,项目名称:VisualGraph,代码行数:18,代码来源:NodeClickListener.java

示例3: getWeight

import org.graphstream.graph.Edge; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected double getWeight(final Edge edge) {
	Double weight = edge.getAttribute(WEIGHT);
	return weight != null ? weight : 0;
}
 
开发者ID:ServiceCutter,项目名称:ServiceCutter,代码行数:9,代码来源:GraphStreamSolver.java

示例4: populateTables

import org.graphstream.graph.Edge; //导入方法依赖的package包/类
private static void populateTables() {
		
		// initialize active edge list
		activeEdgesHS = new HashSet<String>();
		
		// populate node list
		int nodeCountI = graphRef.getNodeCount();
		
		for (int i = 1; i <= nodeCountI; i ++) {
			double scoreI = 
					(((double)i - 1.0) / ((double)nodeCountI - 1.0)) * 100;
			nodeNumScoreAL.add(scoreI);
		}
		
		
//		// populate edge list
//		int edgeCountI = graph.getEdgeCount();
//		
//		for (int i = 1; i <= edgeCountI; i++) {
//			double scoreI = ((i - 1) / (edgeCountI - 1)) * 100;
//			edgeNumScoreAL.add(scoreI);
//		}
		
		// populate edge weight table
		minEdgeWeightD = 999999999999999.0;
		aggEdgeWeightD = 0;
		
		// figure out what the minimum and aggregate edge weights are
		// populate keys in edgeWeightHT
		for (Edge edge : graphRef.getEachEdge()) {		
			double edgeWeightD = (double)edge.getAttribute("length");
			minEdgeWeightD = 
					(edgeWeightD < minEdgeWeightD) ? 
							(edgeWeightD) : (minEdgeWeightD);
			aggEdgeWeightD += edgeWeightD;
			
			// put key into table along with a dummy value
			if (!edgeWeightHT.containsKey(edgeWeightHT)) {
				edgeWeightHT.put(edgeWeightD, 0.0);
			}
			
		}

		// now that we know min/max weight values, go through table keyset
		// and compute weight scores
		for (Double key : edgeWeightHT.keySet()) {
			double weightScoreD = 
					(Math.abs(key-aggEdgeWeightD) / 
							Math.abs(minEdgeWeightD-aggEdgeWeightD)) * 100;
			edgeWeightHT.put(key, weightScoreD);
		}
	
		
	}
 
开发者ID:davidholiday,项目名称:ALTk,代码行数:55,代码来源:holidayTSP2.java


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