netlogo

limitation of forming subset in netlogo

二次信任 提交于 2019-12-13 02:14:49
问题 Dear Netlogo community, Last week I posted the question on the same forum about forming subset from a set in netlogo. Here is the link. How to form subset form a set of numbers in Netlogo The problem with the above thread is that it wont give the subsets if the set contains more than 21 elements. It throws java heap space out of memory exception. I believe this is because the above thread stored all subsets in one list and eventually list of list reached to its maximum range and throws java

Extension not found error with control flow extension

落爺英雄遲暮 提交于 2019-12-13 02:09:35
问题 I am trying to use https://github.com/qiemem/ControlFlowExtension as an alternative to if-else. I have it to added to the extensions folder(C:\Program Files (x86)\NetLogo 5.1.0\extensions). The extracted zipped folder from github. In the NetLogo code I use the following, extensions[ControlFlowExtension-master] But it still shows me the following error: 回答1: There is no release for the extension yet. The zip file that you downloaded is just the source code and doesn't contain the compiled JAR

Create output in an excel file consisting of data rows

跟風遠走 提交于 2019-12-13 01:58:37
问题 I am a beginner in netlogo. I find the Netlogo Manual not always as explicit as I feel it should be, as exemplified by the folowing task. My feeling is that this task ought to be relatively simple, but so far I have not been able to accomplish it. I have searched for hints on this forum to help me, but perhaps my problem is so simple that nobody has yet come up with a corresponding question. The task is: Write data into columns of an Excel file such that for each tick six data points form a

NetLogo, accessing color of a patch

こ雲淡風輕ζ 提交于 2019-12-13 01:39:51
问题 I am trying to apply the following condition: if ( the color of patch -2 -1 is red ) [ some commands ] Could someone please tell me how to write this in NetLogo? 回答1: if ([pcolor] of patch -2 -1 = red) [ ] Pretty much how you put it but in code, read the tutorials and what not and this should be simple. Note that you use pcolor for patches and color for turtles. Good luck! 来源: https://stackoverflow.com/questions/3584034/netlogo-accessing-color-of-a-patch

NetLogo: how to make the calculation of turtle movement easier?

 ̄綄美尐妖づ 提交于 2019-12-13 01:28:45
问题 I am working with NetLogo code written with somebody else (freely available to public). I try to understand how the procedure of turtle moving is elaborated and, most important - how make it computationally faster without loosing sensitivity of turtle movement in relation to worlds' patches? I suppose that the most of the calculation time is used to calculate the distance of each step of turtle movement - I would like to measure only one variable from patch of turtle's origins to last patch

how can i set a probability for each action?

眉间皱痕 提交于 2019-12-13 01:12:36
问题 I've got some turtles which are looking around themselves. For each neighbor they've got, they save the value of "output-heat". The patch with the highest value will get the highest probability and the lowest value the lowest probability. I want the turtle to move to another patch. The moving should be dependent on the probabilities. My code looks like this, but it doesn't work like it should: ask turtles-here[ let temp_ahead [(output-heat + 1)^ Freedom] of patch-at 0 1 let temp_right_ahead [

Local Routing on Complex Network using Netlogo

血红的双手。 提交于 2019-12-13 00:22:25
问题 I created a small undirected network, where some nodes are as sources and some are targets. then I created walkers placed on source nodes. Now, I want to implement a very simple local routing algorithm using this network. Here, my algo steps; 1 go 2 get-list-of-neighbors 3 select one-of from list of neighbors check is-visited: if yes: [remove from the list check is-loop if yes: Die else go to setp 3] 4 else Move-to selected node 5 check is-target? if yes: die else add to list-of-visited and

How to randomly remove block side in a grid?

拜拜、爱过 提交于 2019-12-13 00:11:33
问题 Following on from How to control square size in a grid from square area?, I would like to randomly remove block side in a grid. Here my idea: %% In a first time, I randomly select a white patch in the grid (figure below): let random-patch one-of patches with [pcolor = white] %% Then, I draw red patches to identify intersections between white roads (figure below): ask patches with [ (pxcor mod (side + 1) = 0 ) and (pycor mod (side + 1) = 0 ) ] [set pcolor red] %% Finally, I color in brown all

How to add power law likelihood to Netlogo Model

♀尐吖头ヾ 提交于 2019-12-12 21:37:22
问题 I would like to add a likelihood of natural disaster in my environmantal ABM that follows the power law (often few damage, less often mediocre damage, rarely strong damage, very rarely complete damage). I coded so far the following: to environment ;environmental hits create-hits 1 [ ; I do not know if it makes sense to do that? set shape "circle" set color white set size 0.05 setxy random-xcor random-ycor ] ask hits [ ifelse pcolor = red [die] ;if already red, then stop [ ask n-of random

plot turtles vs energy

老子叫甜甜 提交于 2019-12-12 21:04:17
问题 Hello netlogo community I have a simple model with 100 turtles and each one has a variable called energy. How can I draw a graph that plots for each turtle in the world his energy I mean: x-axis each turtle y-axis energy associated to the turtle Sorry I think is an easy question but I can figure out how to do it. Ideally I would like an histogram like the following: Histogram 回答1: The NetLogo histogram command won't allow you to plot each value individually, but it's not too hard to code it