I have a population of turtles where I would like them to create a random number of links to other turtles based on a 'bias' (a value from 1 to 5) I've given them. Now, if there aren't enough turtles with the same 'bias' then I would like them to first create links with the turtles with the same bias and then create links to random other turtles.
So far I've figured out this much
ask people [
set my_friends 1 + random (average-node-degree * 2)
create-links-to n-of my_friends other people with [bias = [bias] of myself]
]
But then I run into the problem that there might not be enough turtles with the same bias as I would like them to create links to. How do make the turtles create links to random turtles with the 'remaining' number of my_friends?