netlogo

divide NetLogo world into several random parts

狂风中的少年 提交于 2020-04-17 03:24:28
问题 I am trying to create a number of groups of agents on the NetLogo world. I hope each of the groups is located at a specific area without overlap. As I can think of, the easies way to achieve this might be dividing the world into several parts first. Each part consists of a number of patches (say 100 + random 10, which I can set) and is colored with a unique color. Then ask the newly created turtles to move to patches with different colors. Could anybody tell me how to achieve this or give any

Editing file name when using export-view in Netlogo

拟墨画扇 提交于 2020-03-25 05:52:08
问题 I want to use export-view to save an image of my model. I have made a button in the interface to export image (JPG, PNG, or PDF) from the Netlogo. this is my current code in the export-view button file-open user-new-file export-view (word "view1.jpg") set view-number view-number + 1 Currently, file-open command helps in showing a pop-up input window before saving. There is a runtime error of "FILE-OPEN expected input to be a string but got the TRUE/FALSE false instead". I can still save the

There are still some patches that turtle can move on to but ERROR

久未见 提交于 2020-03-23 12:02:35
问题 I ask a turtle A to move to patch that has a neighbor that has the same type of turtle with the turtle A. It is working well until the ERROR (MOVE-TO expected input to be an agent but got NOBODY instead) comes out. Visually there are still some available patches. How to code so that all available patches are occupied and report or stop the program when there is no more patch to occupy? Any comments will be really helpful. I did the following: to set-move ask migrants [let pot-target patches

Netlogo, changing link-with to link-to

纵饮孤独 提交于 2020-03-04 21:52:08
问题 I am trying to create a network of influence for my turtles on my setup. Each turtle has an AD variable randomly set between 0 and 1.Each of them will create 5 undirected links. Now if they have AD low (below 0.3), they should look for someone with high AD in their network (above 0.7) and create a link to that person (to become a follower). I have tried with this code which doesn't work because some networks will not have anyone with AD > 0.7 and so when trying to kill the link I get runtime.

Netlogo, changing link-with to link-to

梦想的初衷 提交于 2020-03-04 21:50:20
问题 I am trying to create a network of influence for my turtles on my setup. Each turtle has an AD variable randomly set between 0 and 1.Each of them will create 5 undirected links. Now if they have AD low (below 0.3), they should look for someone with high AD in their network (above 0.7) and create a link to that person (to become a follower). I have tried with this code which doesn't work because some networks will not have anyone with AD > 0.7 and so when trying to kill the link I get runtime.

Netlogo, changing link-with to link-to

南楼画角 提交于 2020-03-04 21:50:13
问题 I am trying to create a network of influence for my turtles on my setup. Each turtle has an AD variable randomly set between 0 and 1.Each of them will create 5 undirected links. Now if they have AD low (below 0.3), they should look for someone with high AD in their network (above 0.7) and create a link to that person (to become a follower). I have tried with this code which doesn't work because some networks will not have anyone with AD > 0.7 and so when trying to kill the link I get runtime.

Netlogo, changing link-with to link-to

你说的曾经没有我的故事 提交于 2020-03-04 21:50:08
问题 I am trying to create a network of influence for my turtles on my setup. Each turtle has an AD variable randomly set between 0 and 1.Each of them will create 5 undirected links. Now if they have AD low (below 0.3), they should look for someone with high AD in their network (above 0.7) and create a link to that person (to become a follower). I have tried with this code which doesn't work because some networks will not have anyone with AD > 0.7 and so when trying to kill the link I get runtime.

Interface variables - sliders affecting sliders

China☆狼群 提交于 2020-02-06 04:31:21
问题 Let's say I have two sliders on my interface. Slider one goes from 0-500 and slider two goes from 0-100. Is there anyway of setting it so that the value of slider one influences the possible values for slider two. So if I set slider one to 500, slider two can only be values from 0-30, for example. Alternatively it would not necessarily have to be a slider affecting another slier, it could be a button. So if I have buttons A and B, if I select A the slider can be 0-10 but if I select B only 20

Reporting in a chart the life-cycle of turtles

ε祈祈猫儿з 提交于 2020-02-04 00:43:33
问题 I am working on a task that includes plotting the life-cycle of items. These items are created and added in a list with owners having different breeds (for simplicity I am considering only two breeds). If the number of items in a list is greater than the list's length (perhaps, length = 5 ), then the last item of the list is deleted. I am doing this because, at a certain point, the item will stop to be shared from turtles, so it will disappear from the plot ( it will be equal to 0 in the y

How to select the item with highest value in a list

谁都会走 提交于 2020-01-25 08:58:05
问题 I have a list for each turtle I am considering in my model. I would like to select an item of a list, specifically, the item with highest quality. Quality is a parameter in the range [0,1]. My issues regards how to assign the parameter to each item, then select the item with the highest parameter value. To better explain : an example of list is (item 4, item3, item2, item1) . What I would like is: item 4 with quality #, item 3 with quality #, and so on. When I create the items of a list, they