Questions tagged [agentset]

32 questions
1
vote
2 answers

How to make a turtle able to save other turtles ID in Netlogo?

Here is what I want to do: I want a team consists of 3 turtles in a group. All turtles need to store their own ID and teammatesID inside the variable called teammatesID. (Imagine you want to create a group, you will put your name and your…
linda
  • 117
  • 9
1
vote
2 answers

Removing an agentset from another agentset (the agents from the first set which are also present in the second set)

in my netlogo code I have a network with companies (that is my breed). I want to ask the companies to share information with their neighbors and their neighbors and so on, this works (see code below, the agentsets are b, c and d). However when I…
Wessel K
  • 55
  • 6
1
vote
1 answer

NetLogo - exchanging variable values across links or agentsets (not within breeds)

I am building a NetLogo model that tries to explain how agents find information they need to make a decision by bumping into other agents as they move about a space. There are three types of agents, each type has their own behavior rules and…
LRB
  • 25
  • 6
1
vote
2 answers

Making agentset outof list

This is relevant to the previous question just asked. How can I convert list(which representing turtles) to a agentset? For example, I want to make agentset which contains 4 elements [turtle 0 turtle 3 turtle 4 turtle 7] out of list ["turtle 0"…
Hannah Lee
  • 75
  • 11
1
vote
1 answer

Netlogo, Neighbors4 and selecting by agent-color

I am new to NetLogo, so if my question reads like a novice...that's why. I am using the neigbhors4 command to identify the four neighbors of an aggressor agent. I then want to select from the four neighbors based on their color and a priority…
HS3
  • 25
  • 5
0
votes
1 answer

How to calcualte the average xcor of each agentset in a list in NetLogo

I'm creating clusters of agents using the nw extension weak-component-clusters. It produces a list of agentsets. My first goal is to calculate the average xcor and ycor of each of those agentsets in the list. I can use map to count the number of…
Yaser Baqi
  • 155
  • 1
  • 12
0
votes
2 answers

NetLogo - setting variable in calling breed in nested ask of same type of breed

I'm trying to set "parent" variable in a nested ask but without luck. In code below I use an "outer" ask instruction "ask turtle 0" and below this a nested "ask other turtles". In the nested ask I'm trying to set a variable of the calling…
mijen67
  • 43
  • 9
0
votes
1 answer

Assign variable to breed based on percentage

I'm trying to assign my breed called "evacuees" their age based on a percentage. The number of evacuees is based on a slider in the interface, meaning that I don't have a fixed population to work with. They have two properties, "sex" and "age",…
misch
  • 11
  • 3
0
votes
2 answers

In NetLogo, how to cycle through an agentset and check conditions before performing an action if true?

I'm building a model loosely based on the Sugarscape model to look at corporate takeovers. I need to check the attributes of a neighbouring turtle, perform a calculation on it's attributes and then choose if the acting turtle wishes to eat the…
0
votes
1 answer

Moving turtles to agentset of patches

If I select an agentset of patches, for example: let myset patches with [abs pxcor < (grid-size / 2) and abs pycor < (grid-size / 2)] ask myset [print self] (patch 1 -1) (patch -1 -1) (patch 0 0) (patch 1 0) (patch 0 1) (patch…
Nelis
  • 91
  • 1
  • 11
0
votes
1 answer

Each Turtle need to pick different agents from the same agentset

i got a problem with my breed (amministrazione spurgatori). I need each one of them to pick a different target from the same agentset (manholes with segnalato? = true) but they all head to the same patch. I think the problem is the code in "to…
0
votes
2 answers

How can I extract agent-set by using RNetLogo?

I have trouble getting agent-sets in R using RNetLogo package NLCommand("setup") who <- list() who[[i]] <- NLGetAgentSet(c("who","xcor","ycor"), "turtles") Is there something wrong in using NLGetAgetSet function? I need some help.
Hannah Lee
  • 75
  • 11
0
votes
1 answer

Order of the agents in agentset don't match

I have a doubt and apologize if the answer is very obvious. I created the following code. Pretty simple & straightforward: patches-own [ tl ls ls2 ls3 ls4 tsl] turtles-own [mysize] to setup clear-all reset-ticks crt 5 ask turtles [ set…
Raj
  • 1,049
  • 3
  • 16
  • 30
0
votes
0 answers

A list containing NOBODY as one of its entities

I have a sub-routing in my code where each patch is asked to pick its closest & farthest turtle based on certain conditions. I keep getting this error after a couple of ticks OF expected input to be a turtle agentset or turtle but got NOBODY…
Raj
  • 1,049
  • 3
  • 16
  • 30
0
votes
1 answer

How to convert a list of 1 to an individual turtle

I have a list which will always contain only 1 turtle in it. It is a patch-only variable and hence when any patch is inspected it appears like best-turtle: [(turtle 1)]. I am reference this particular turtle in another routine using the following…
Raj
  • 1,049
  • 3
  • 16
  • 30