private void saveCalculatedValue(Node node, Column clusteringColumn, double nodeClusteringCoefficient) { if (clusteringColumn == null) { return; } node.setAttribute(clusteringColumn, nodeClusteringCoefficient); }
private void saveComputedComponents(LinkedList<LinkedList<Node>> components, Column componentCol) { int i = 0; for (LinkedList<Node> component : components) { for (Node s : component) { s.setAttribute(componentCol, i); } i++; } }
private void saveCalculatedValues(Map<Node, Integer> indices, double[] nodeAuthority, double[] nodeHubs) { for (Node n : indices.keySet()) { int index = indices.get(n); n.setAttribute(AUTHORITY, (float) nodeAuthority[index]); n.setAttribute(HUB, (float) nodeHubs[index]); } }
private void saveCalculatedValues(Graph graph, HashMap<Node, Integer> indicies, double[] nodeEccentricity, double[] nodeBetweenness, double[] nodeCloseness, double[] nodeHarmonicCloseness) { for (Node s : graph.getNodes()) { int s_index = indicies.get(s); s.setAttribute(ECCENTRICITY, nodeEccentricity[s_index]); s.setAttribute(CLOSENESS, nodeCloseness[s_index]); s.setAttribute(HARMONIC_CLOSENESS, nodeHarmonicCloseness[s_index]); s.setAttribute(BETWEENNESS, nodeBetweenness[s_index]); } }
private void saveCalculatedValues(Graph graph, Column attributeColumn, HashMap<Integer, Node> indicies, double[] eigCenrtalities) { int N = graph.getNodeCount(); for (int i = 0; i < N; i++) { Node s = indicies.get(i); s.setAttribute(attributeColumn, eigCenrtalities[i]); } }
private void saveCalculatedValues(Graph graph, Column attributeColumn, HashMap<Node, Integer> indicies, double[] nodePagrank) { for (Node s : graph.getNodes()) { int s_index = indicies.get(s); s.setAttribute(attributeColumn, nodePagrank[s_index]); } }
private void saveValues(int[] struct, Graph graph, CommunityStructure theStructure) { Table nodeTable = graph.getModel().getNodeTable(); Column modCol = nodeTable.getColumn(MODULARITY_CLASS); if (modCol == null) { modCol = nodeTable.addColumn(MODULARITY_CLASS, "Modularity Class", Integer.class, 0); } for (Node n : graph.getNodes()) { int n_index = theStructure.map.get(n); n.setAttribute(modCol, struct[n_index]); } }
network[v].node.setAttribute(clusteringCol, nodeClustering[v]); if (!isDirected) { network[v].node.setAttribute(triCount, triangles[v]);
n.setAttribute(DEGREE, degree); if (isDirected) { n.setAttribute(INDEGREE, inDegree); n.setAttribute(OUTDEGREE, outDegree); updateDegreeDists(inDegree, outDegree, degree); } else {
n.setAttribute(WINDEGREE, totalInWeight); n.setAttribute(WOUTDEGREE, totalOutWeight); n.setAttribute(WDEGREE, totalWeight); totalWeight += (e.isSelfLoop() ? 2 : 1) * e.getWeight(); n.setAttribute(WDEGREE, totalWeight); updateDegreeDists(totalWeight);
switch (tr) { case INTERVAL: n.setAttribute(dynamicDegreeColumn, degree, new Interval(interval.getLow(), interval.getLow() + tick)); break; case TIMESTAMP: n.setAttribute(dynamicDegreeColumn, degree, interval.getLow()); n.setAttribute(dynamicDegreeColumn, degree, interval.getHigh()); break; n.setAttribute(dynamicInDegreeColumn, indegree, new Interval(interval.getLow(), interval.getLow() + tick)); n.setAttribute(dynamicOutDegreeColumn, outdegree, new Interval(interval.getLow(), interval.getLow() + tick)); break; case TIMESTAMP: n.setAttribute(dynamicInDegreeColumn, indegree, interval.getLow()); n.setAttribute(dynamicInDegreeColumn, indegree, interval.getHigh()); n.setAttribute(dynamicOutDegreeColumn, outdegree, interval.getLow()); n.setAttribute(dynamicOutDegreeColumn, outdegree, interval.getHigh()); break;
n.setAttribute(testCol, Boolean.TRUE);
n.setAttribute(dynamicCoefficientColumn, coef, new Interval(interval.getLow(), interval.getLow() + tick)); break; case TIMESTAMP: n.setAttribute(dynamicCoefficientColumn, coef, interval.getLow()); n.setAttribute(dynamicCoefficientColumn, coef, interval.getHigh()); break;
n.setAttribute(col, avg);
private Node copyNode(Node node, Graph graph) { Node copy = buildNode(graph, node.getLabel()); //Copy properties (position, size and color): copy.setX(node.x()); copy.setY(node.y()); copy.setZ(node.z()); copy.setSize(node.size()); copy.setR(node.r()); copy.setG(node.g()); copy.setB(node.b()); copy.setAlpha(node.alpha()); Table nodeTable = graph.getModel().getNodeTable(); //Copy attributes: for (Column column : nodeTable) { if (!column.isReadOnly()) { copy.setAttribute(column, node.getAttribute(column)); } } graph.addNode(copy); return copy; }