netlogo

How to include more breeds in max-one-of and plot the highest value found and its distribution

≡放荡痞女 提交于 2019-12-25 01:14:08
问题 I am using lists to build a model. I have three breeds, but only two of them have their own lists where to collect items created (and that should create items). I would like to select a random turtle and find the item with highest attribute into its bag. Then I would like to plot the attribute and its distribution as follows: plotxy attribute1 fun2 where attribute1 is the attribute defined within the ask link-neighbors : set attribute1 attribute1_b - m and fun2 should be defined as set fun2

Copy the link breed variable in the patch below

无人久伴 提交于 2019-12-25 00:21:39
问题 I have a network of nodes and links. This figure is a capture of the world. The graph represents streets of a city. I have imported a shapefile with the gis extension. The gray lines are links, black dots are nodes and red dots represent people. The people move heading to the next node. In a street corner, the red dot chooses next street by examining the variable popularity owned by the link. The links breed has a variable, popularity , whose value I would like to copy in the patches that are

Leader selection for crowd of turtles (NetLogo)

那年仲夏 提交于 2019-12-24 23:09:56
问题 I am using NetLogo for a simulation in which i have to deal with many turtles each representing a robot. I need to find an algorithm for leader selection. I want to make leaders in between the crowd which will ultimately lead crowd toward the predefined target. Or is there any other way to which any turtle dynamically changes its behavior to become a leader. Any one if could help. As we see in the model library a model named "Flocking". In which a random turtles leads all turtles. But i don't

Error in plotting: OF expected input to be a turtle agentset or turtle

本秂侑毒 提交于 2019-12-24 19:39:55
问题 I am studying a model where children play with some toys. The characteristics of the toys are included in attribute1 . I had to create a new variable, attribute1_b , as I wanted to have initially the same original value for the neighbours in order to subtract a small quantity m . I would like to plot the new value of attribute1 to study how it changes through time, respect of fun2 (i.e. 1- (attribute1-m) ), but unfortunately I have found difficulties in defining fun2 ( global, children-own,

Leader selection from crowd of turtles NetLogo

荒凉一梦 提交于 2019-12-24 17:10:02
问题 Is there any way that i should ask / make the circled one turtles( robots ) that you are leaders now (i.e. setting is-leader? true for them ). As i am using Robots-own [ is-leader? ] For reference please see this image. 回答1: Given your elaboration on your goal in your comments, but noting that Seth is (as usual) completely correct in his warnings, you could try the following: turtles-own [is-leader?] to setup ca ask n-of 50 patches [sprout 1] choose-leaders end to choose-leaders ask max-n-of

error in applying an ascii to netlogo with apply-raster

笑着哭i 提交于 2019-12-24 17:05:05
问题 I am trying to apply an ascii (241 rows, 463 columns) to netlogo using the following code: set my-dataset "data/my-folder/my-file.asc" resize-world 0 gis:width-of (gis:load-dataset my-dataset) - 1 0 gis:height-of (gis:load-dataset my-dataset) - 1 gis:set-world-envelope-ds (gis:envelope-of (gis:load-dataset my-dataset)) gis:apply-raster (gis:load-dataset my-dataset) my-variable In the resize-world command, I added the -1 since netlogo starts at 0, while gis:width-of starts at 1.The result is a

How do I delete turtle pen lines in netlogo?

99封情书 提交于 2019-12-24 16:14:21
问题 I want to delete only turtle pen lines from a halfway point in a model run. The "clear-drawing" primitive seems to achieve that, but my problem is that I can't run it directly from an agent, or use "ask observer [clear-drawing]". Is there a way to trigger this observer command from an agent context (I expect not), or is there another way of erasing turtle pen lines? My solution to re-draw using pens having the background color is rubbish. 回答1: Instead of redrawing using the background color,

NetLogo - Creation of a cluster as a farm manage by a turtle

眉间皱痕 提交于 2019-12-24 15:24:05
问题 In the setup I would create a command that generate a random number of cluster with a random dimension. Each cluster it would be managed by an agent (farmer). Every single patch represent a potential crop that farmer can cultivate with a different type of seeds. It would be worth use the function in-radius? If you need more details ask me. Thank you very much for your answers, it's exactly what I need! Now I've another question, I implemented the program as you suggest and now I displaying a

edge to edge distance between patches with netlogo

末鹿安然 提交于 2019-12-24 13:28:37
问题 How can I compute edge to edge distance between patches with netlogo ? With the function "distance", distance between patches is calculated from center of patches. Thank you very much for your help. Have a good day Marine 回答1: If you want to measure the distance between the edges of your patches, you can create temporary turtles on the edges of your patches and measure the distance between these turtles. I assume that you want the shortest distance between any two points located on the edges

Progress of simulations in headless mode

青春壹個敷衍的年華 提交于 2019-12-24 12:36:09
问题 Is there any way to check the progress of simulations in headless mode as opposed to gui? Basic Code: $ ~/netlogo-5.1.0/netlogo-headless.sh \ --model ~/myproject/MyModel.nlogo \ --experiment MyExperiment \ --table ~/myproject/MyNewOutputData.csv 回答1: I'd suggest doing tail -f ~/myproject/MyNewOutputData.csv . This will show you a live view of the output file as it is being written to. 来源: https://stackoverflow.com/questions/28457997/progress-of-simulations-in-headless-mode