Questions tagged [agentset]
32 questions
5
votes
1 answer
Print the elements in an agentset
I want to find the patches which satisfy certain conditions, using the following command:
print patches with [ (closest-party = turtle 1) and (distance < 10)]
give this as the result: (agentset, 7 patches)
how do i find those 7 patches inside that…

Raj
- 1,049
- 3
- 16
- 30
4
votes
2 answers
How to MAP over agentset?
I need to iterate over a specific agentset of patches and get the neighbors of them all and then join those...
I'd do something like
reduce patch-set (map [patch-set neighbors self] patches with [somecondition?])
But MAP and REDUCE won't work on…

caeus
- 3,084
- 1
- 22
- 36
4
votes
2 answers
How to find all the agents who are not included in an agentset?
I have an agentset named giant-component, and I set all the agents' color to red:
ask giant-component [
set color red
ask my-links [
set color red
]
]
Now I need to set all other turtles' color to blue. I know that the easy…

Ramy Al Zuhouri
- 21,580
- 26
- 105
- 187
2
votes
3 answers
Netlogo - Given an Agentset of 2+ Turtles, find the most frequent color
Given an agentset of two or more turtles, how do I find the most frequent color?
I would like to do something like that, if possible:
set my_color [mostfrequentcolor] of my_agentset

Marco Turna
- 23
- 4
2
votes
1 answer
adding agentset from different agents togother into a let
my model is a network of agents connected to each other with links.
I try to create a agentset from the neighbors of an agents and their neigbors and so on (I need this to assign different values to it).
However when I create a let with the agentset…

Wessel K
- 55
- 6
2
votes
1 answer
Netlogo: How to iterate over agentset and set variable speed
I am attempting to iterate over a set of turtles and assign each of them a different, random speed. When I attempt to use:foreach turtles [ ... ] I get an error message stating "cannot iterate over agentset". I know I can use ask for setting all…

bubbalouie
- 643
- 3
- 10
- 18
2
votes
1 answer
How to pick random agents from an agentset to create a new agenset?
I have an agent-set of all the turtles. I want to randomly pick 5 turtles from this agent-set and assign a value of 1 to them. The other 5, ones that were not selected should take the value of 0.
I tried using the random function but it's not…

Raj
- 1,049
- 3
- 16
- 30
2
votes
1 answer
NetLogo: kill rest of agentset
to change-vgags
ifelse (((-0.007333 * x * x) + (0.07333 * x) + 1) = 1)
[stop]
[ifelse (((-0.007333 * x * x) + (0.07333 * x) + 1) > 1)
[ask n-of (((((-0.007333 * x * x) + (0.07333 * x) + (1)) / 48) - (1 / 48)) * 590) gags with [pcolor = red…

Amy
- 81
- 7
1
vote
1 answer
Create agentset with turtles also in other agentsets in netlogo
I am working on an organizational behavior problem where I have a work group/community of practice I'm trying to create out of agents from each region. As seen below, I am using the GIS extension to load in a regional shapefile and then randomly…

Collin Yarbrough
- 13
- 3
1
vote
1 answer
Creating agentset based on list values NetLogo
I'd like to subset agents based on values I have in a list. In the code below I have a list of values, called "ActiveID". I'd like to create an agentset of all the turtles who have a turtle-own "ID" values that matches with the numbers in the list…

Kristy Ferraro
- 13
- 2
1
vote
1 answer
How to extract the who number of agents in an agentset? (NetLogo)
I have a patch variable set as visitantBees [].
The intention is that each patch has a record of which agents were in it.
The method for registering the "visiting agents" is as follows:
to computing Frequency
ask patches
[
if any?…

Raíssa Fernandes
- 21
- 1
1
vote
2 answers
Is it possible to ask agents to leave an agentset without relying on their variables in NetLogo?
Although NetLogo has a good set of primitives allowing for the handy creation of agentsets, sometimes we might want to ask agents to 'manually' add themselves to an agentset as part of a procedure they're running - for instance, by using…

Matteo
- 2,774
- 1
- 6
- 22
1
vote
1 answer
NetLogo: Creating patch groups from NLCD
I'm fairly new to NetLogo and its programming capabilities. I am trying to create a grouping mechanism for my code so that NLCD classifications can be mirrored in my NetLogo world.
For example, the NLCD veg-type 11 and 12 are for areas classified as…

Alyssa T
- 79
- 6
1
vote
1 answer
Netlogo: Store agentset in patch property
I am simulating a neighborhood. Patches represent households, turtles people living there.
I want to track "households" and thought it would be convenient to store an agentset of each household at the patch. That would allow me to do easy…

tcdejong
- 88
- 6
1
vote
1 answer
how to access an attribute inside an agent in agentset for netlogo?
Here is the problem:
I need to compare a value inside turtles-own, which is best-food, with the other agents in the same agentset but I don't know how to make the agent ask his teammates about this value and I need them to compare with each other'…

linda
- 117
- 9