We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › social networks library
Page Index Toggle Pages: 1
social networks library (Read 281 times)
social networks library
Nov 24th, 2008, 11:57pm
 
I´m trying to make a network of 100 * 100 nodes. and somehow they are all next to each other. the commands
   int m = i +8;
   int n = j +8;
are obviously ignored.
when I try to find a special node 25:25 and I ask for the coordinates, I get 3 and 29?

import socialNetworks.*;
Network net = new Network(this);

void setup(){
size(1000,1000);
for (int i = 0; i < 100; i = i+1) {
 for (int j = 0; j < 100; j = j+1) {
   String t = str(i)+":"+str(j);
   int m = i +8;
   int n = j +8;
   Node a = new Node(this, t, m, n);
   net.addNode(a);
 }
}
}

void draw(){
background(150,150,150);
net.draw();
net.selection.addNodesByTitleExactMatch("25:25");
net.selection.nodeSize(10);
net.selection.nodeColor(color(0,255,0));
int r = getX();
int s = getY();
println(r);
println(s);
}
Page Index Toggle Pages: 1