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 ;
}
}
}
--
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.
To unsubscribe from this group and stop receiving emails from it, send an email to gama-platform+unsubscribe@googlegroups.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?thanksSrirama
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
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.
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 ;
}
}
}
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
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.