a growing scale free network

37 views
Skip to first unread message

Srirama Bhamidipati

unread,
Aug 12, 2015, 10:08:56 AM8/12/15
to GAMA
Hi,

I am looking for a model that starts with a scale free network and slowly as the simulation proceeds, after every 'n' cycles adds a node and connects itself to the closest hub. 

I could not find something similar in Model library unless I missed something. Is there any such model?

thanks
Srirama

Patrick Taillandier

unread,
Aug 12, 2015, 11:20:15 AM8/12/15
to gama-p...@googlegroups.com
Hi,

Nothing similar in the model library, but here an example of what can be done:

model graphdensification


global {

graph the_graph ;

init {

the_graph <- generate_barabasi_albert(node_agent, edge_agent, 4,3, true);

}

reflex add_node when: every(10){

create node_agent returns: created_nodes

node_agent new_node <- first(created_nodes);

node_agent closest_node <- node_agent closest_to new_node;

add edge: (new_node::closest_node) to: the_graph;

}

}


species edge_agent {

aspect default {

draw shape color: #black;

}

}


species node_agent {

aspect default {

draw circle(1) color:#red;

}

}


experiment graphdensification type: gui {

output {

monitor "nb_nodes" value: length(node_agent);

monitor "nb_edges" value: length(edge_agent);

display map type: opengl{

species edge_agent ;

species node_agent ;

}

}

}


cheers,

Patrick

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.
To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

Srirama Bhamidipati

unread,
Aug 13, 2015, 12:48:41 PM8/13/15
to gama-p...@googlegroups.com
Thank you Patrick.

But the new node is connecting to nearest node, not to the nearest hub. I am looking for something like preferential attachment. I know there is a plugin for that, not sure if that has been made into GAMA yet. And I think in that plugin, a preferential attachment can only be initialised and cannot take new nodes during the simulation. Or am I wrong? Do you know something about how to do it with that plugin?

thanks
Srirama
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

Patrick Taillandier

unread,
Aug 13, 2015, 12:55:03 PM8/13/15
to gama-p...@googlegroups.com
Hi,

What is a "hub" or preferential attachment?

Patrick


2015-08-13 18:48 GMT+02:00 Srirama Bhamidipati <b.sr...@gmail.com>:
Thank you Patrick.

But the new node is connected to nearest node, not to the nearest hub. Something like preferential attachment. I know there is a plugin for that, not sure if that has been made into GAMA yet. And I think in that plugin, a preferential attachment can only be initialised and cannot take new nodes during the simulation. Or am I wrong? Do you know something about how to do it with that plugin?

thanks
Srirama
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

Srirama Bhamidipati

unread,
Aug 13, 2015, 1:05:51 PM8/13/15
to GAMA
I am sorry. I assumed you might know. 

Hub is a node (among the nodes) which is connected to more nodes (via edges of course) than a less connected node. It basically is a network structure where less number of nodes are connected to many nodes and a great number of nodes are connected to few nodes. Like the power law. 
Like the barabasi albert networks you have in GAMA library. 

I just do not know how to add a new node that follows preferential attachment or barabasi albert algorithm 
Srirama
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

Srirama Bhamidipati

unread,
Aug 13, 2015, 1:08:39 PM8/13/15
to GAMA
Just found this http://webwhompers.com/network-dynamics/6-network-dynamics/55-preferential-attachment-algorithm.html

something like that, a new node added a every few cycles.

Patrick Taillandier

unread,
Aug 13, 2015, 1:18:52 PM8/13/15
to gama-p...@googlegroups.com
A new proposition :) :

model graphdensification


global {

graph the_graph ;

init {

the_graph <- generate_barabasi_albert(node_agent, edge_agent, 4,3, true);

}

reflex add_node when: every(10){

int index <- rnd_choice(node_agent collect (the_graph degree_of each));

node_agent old_node <- node_agent[index];

create node_agent {

location <- any_location_in(old_node + 10);

add edge: (self::old_node) to: the_graph;

}

}

}


species edge_agent {

aspect default {

draw shape color: #black;

}

}


species node_agent {

aspect default {

draw circle(1) color:#red;

}

}


experiment graphdensification type: gui {

output {

monitor "nb_nodes" value: length(node_agent);

monitor "nb_edges" value: length(edge_agent);

display map type: opengl{

species edge_agent ;

species node_agent ;

}

}

}



cheers,

Patrick

Srirama
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platfor...@googlegroups.com.

Srirama Bhamidipati

unread,
Aug 13, 2015, 4:33:31 PM8/13/15
to GAMA
Ah Thank you Patrick. I did something similar, i could not think of "collect". Collect makes it easier.
thanks.
Srirama
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.

To post to this group, send email to gama-p...@googlegroups.com.
Visit this group at http://groups.google.com/group/gama-platform.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "GAMA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages