agentset

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

女生的网名这么多〃 提交于 2019-12-24 08:38:15
问题 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 friends' name in a list, that's why this variable need to store ownID, I am bad in explaning things..) Instead of just showing (agentset,3 turtles) , I need them to be able to show all teammates ID. After they have gathered all 3 members , they will get

Making agentset outof list

和自甴很熟 提交于 2019-12-11 05:41:46
问题 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" "turtle 3" "turtle 4" "turtle 7"] I've tried "foreach" before. Thank you in advance~!! 回答1: I am not sure why you would need to work with a list like ["turtle 0" "turtle 3" "turtle 4" "turtle 7"] in the first place. Storing references to agents as

How to find all the agents who are not included in an agentset?

自闭症网瘾萝莉.ら 提交于 2019-12-10 17:47:32
问题 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 trick would be to first set all turtles' color to blue, and then colour all the giant component to red, but during the simulation it may get confusing for the user to see it. Is there a way to get all the turtles that are not inside giant-component? 回答1: The answer above