Hi I'm new to NetLogo and would appreciate your assistance in creating links between agents.
I've already written this code and it doesn't create links for some reason but does not indicate an error either.
I want to randomly assign links between turtles.
`
turtles-own [wealth]
breed [consumers consumer]
breed [investors investor]
to setup
clear-all
setup-people
if variant = "network" [ make-network ]
reset-ticks
end
to setup-people
set-default-shape turtles "person"
create-turtles initial-persons [
setxy random-xcor random-ycor
let breed-rand random-float 200 ;;change this into odd and even numbers later
set wealth 1000
ifelse breed-rand > 100 [
set breed consumers
set color red
] [
set breed investors
set color sky
]
]
end
to make-network
ask turtles [
create-links-with other turtles
show my-links
]
end
to go
ask turtles [
economic-activity
]
tick
end
to economic-activity
ifelse breed = consumers [
consume
] [
if breed = investors
[invest]
]
end
to consume ;; turtle procedure
if breed = consumers [
fd 5
set wealth wealth - 1
]
end
to invest
if breed = investors [
fd 5
set wealth wealth + 1
]
end`
Thanks in advance!
Best, D