HI,
I am new in NetLogo, I have created two types of influential nodes. One who
has highest in-degree and lowest or none out-degree. Another type of nodes
has highest out-degree and lowest or none in-degree. Below is the code for
these two types of nodes.
Now, I want to create a network of 10,000 nodes comprising of 2 and 8% of
both types of nodes. Can anyone help me, please?
I want to create a network which matches the real-world data set. I want to
create a network of the size equal to the real world dataset. I want that
suppose real-world dataset has 8 influential nodes than my simulation also
has 8 nodes.
globals [bridge_node central_node central_node2 prob flag]
breed [followers follower]
breed [followeds followed]
directed-link-breed [inDegrees inDeg] ; link-to
directed-link-breed [outDegrees outDeg] ; link-from
to setup ; a button
clear-all
set-default-shape turtles "circle"
set flag True
reset-ticks
end
to influential_node1 ;a button
if flag = False [ stop ]
create-followers 1
[
set color turquoise
set central_node self
]
while [count turtles <= Num-Nodes] ;Num-Nodes is a slider
[
create-turtles 1
[
set color turquoise
set prob random-float 1
ifelse prob <= 0.001
[
create-outDeg-from central_node
[
set thickness 0.25
set color grey
]
]
[
create-inDeg-to central_node
[
set thickness 0.25
set color grey
]
]
]
layout
tick
]
set flag False
end
to influential_node2 ; a button
if flag = False [ stop ]
create-followeds 1
[
set color red
set central_node2 self
]
while [count turtles <= Num-Nodes] ;Num-Nodes is a slider
[
create-turtles 1
[
set color red
set prob random-float 1
ifelse prob <= 0.001
[
create-inDeg-to central_node2
[
set thickness 0.25
set color grey
]
]
[
create-outDeg-from central_node2
[
set thickness 0.25
set color grey
]
]
]
layout
tick
]
set flag False
end
to layout
layout-spring turtles links 0.5 2 1
ask turtles [
facexy 0 0
fd (distancexy 0 0) / 100 ]
end
--
You received this message because you are subscribed to the Google Groups
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.