本文整理汇总了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;
}
示例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);
}
}
}
示例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;
}
示例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);
}
}