netlogo

Netlogo transition, backwards compatibility

你离开我真会死。 提交于 2019-12-22 00:13:59
问题 'd like to upgrade (if that's the word) a 100-150 of home-grown Netlogo 4.1.3 programs to Netlogo 6, preferably in batch by means of Perl or another scripting language, followed by a (necessary) manual inspection and finish. To my dismay Netlogo 6 won't open Netlogo 4 files, so I've upgraded a few of them by opening them in Netlogo 5, save and reopen in Netlogo 6 and save. Not a particularly elegant way. Any advice?. 回答1: It looks like the reason Netlogo 6 won't read the 4.1.3 files is that

Drawing a super-ellipse with a turtle

坚强是说给别人听的谎言 提交于 2019-12-20 05:59:22
问题 Obviously, any shape drawable by other means can be drawn by a turtle. Circles and squares are easy rt 1 fd .0 and if ticks mod 100 = 0 [rt 90] fd 1 Super-ellipses not so much. (regular ellipses are not trivial either.) The Wikipedia article on super-ellipses if you need to be refreshed on the topic. Any input is appreciated. Using a pendown turtle is there way to make a super-ellipse that emerges from turtle movement? 回答1: I have 1/4 of it, I suppose you could piece-wise put the other three

extension exception: 1944553 while applying raster netlogo gis

随声附和 提交于 2019-12-20 04:34:11
问题 I am trying to load an ascii into Netlogo with apply-raster from the GIS extension. While I did this many times before (although not with this specific ascii), netlogo now throws the following error: extension exception: 1944553 error while observer running GIS:APPLY-RASTER I am not sure why this is happening. The ascii has a projection file with it (WKT), which should work fine: GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT[

NetLogo - using BehaviorSpace get all turtles locations as the result of each repetition

て烟熏妆下的殇ゞ 提交于 2019-12-20 03:26:09
问题 I am using BehaviorSpace to run the model hundreds of times with different parameters. But I need to know the locations of all turtles as a result instead of only the number of turtles. How can I achieve it with BehaviorSpace? Currently, I output the results in a csv file by this code: to-report get-locations report (list xcor ycor) end to generate-output file-open "model_r_1.0_locations.csv" file-print csv:to-row get-locations file-close end but all results are popped into same csv file, so

NetLogo BehaviorSpace memory size constraint

前提是你 提交于 2019-12-20 03:15:25
问题 In my model I'm using behaviour space to carry out a number of runs, with variables changing for each run and the output being stored in a *.csv for later analysis. The model runs fine for the first few iterations, but quickly slows as the data grows. My questions is will file-flush when used in behaviour space help this? Or is there a way around it? Cheers Simon 回答1: Make sure you are using table format output and spreadsheet format is disabled. At http://ccl.northwestern.edu/netlogo/docs

Turtles, patches and their moving sequentially from one patch to the next

邮差的信 提交于 2019-12-19 11:58:30
问题 Platfrom : NetLogo Question I want to move my flag specific 3 point A(-12 8) B(-5 12) C(6 4) -While travelling this point plot energy/time randomly decrease. -When reach C flag will die. I asked before and found this solution for moving. ( When turtle reached 2. point it will not stop ) - LINES1 - breed [cities city] breed [flag person] flag-own [target] to setup clear-all create-flag 1 [ set size 6 set shape "by" setxy -5 3 set target patch -10 5 face target ] < other commands > end to go

How make a list of cumulative sum in netlogo

旧街凉风 提交于 2019-12-19 04:34:30
问题 How can i make a list of cumulative sum of a other list? i tried it that way: ;;all temperatrue-values around the turtle saved in list set temperature_values (list [(output-heat + 1)^ Freedom] of neighbors) ;;build cumulative value of temperatures and put each value in list let tempsum 0 set tempsum_list [] foreach temperature_values [set tempsum (tempsum + ? ) set tempsum_list fput tempsum tempsum_list ] but it doesn't work. can anyone fix this problem? it says that "+ excepted a input but

RNetlogo and NetLogo 5.3 error

被刻印的时光 ゝ 提交于 2019-12-19 04:12:58
问题 I have been using RNetLogo with NetLogo 5.2.1 without troubles. Now I am using NetLogo 5.3 and I get this error: > library(RNetLogo) > nl.path <- "/Applications/NetLogo 5.3/" > NLStart(nl.path, gui = FALSE) java.lang.NoClassDefFoundError: org/nlogo/workspace/Controllable at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) Caused by: java.lang.ClassNotFoundException at RJavaClassLoader.findClass(RJavaClassLoader.java:383) at java.lang.ClassLoader.loadClass

To build patch clusters at large spatial scales

*爱你&永不变心* 提交于 2019-12-18 09:39:33
问题 I used the code from How to create cluster patches that do not overlap between them to build patches as shown in the first figure below. Here is the code : to make-cluster loop [ let cluster [patches in-radius (2 + random-float 2)] of one-of patches if all? (patch-set [neighbors] of cluster) [pcolor = black] [ ask cluster [ set pcolor green ] stop ] ] clear-all repeat 20 [ make-cluster ] When I use this code in a large spatial extent (i.e. 1000 x 1000 patches with patch size = 1 pixel), green

how to randomly select a neighbor patch that has a higher elevation in netlogo

霸气de小男生 提交于 2019-12-18 09:05:56
问题 how to randomly select among all the neighbour patches that are higher instead of the highest neighbour patch? I was thinking to remove (if elevation >= [elevation] of max-one-of neighbors [elevation] [stop]) and place "[stop]" in [move-to-one-of neighbors [stop]] to move ; a turtle procedure if elevation >= [elevation] of max-one-of neighbors [elevation] [stop] ifelse random-float 1 < q [uphill elevation] [move-to one-of neighbors] end 回答1: one-of randomly selects an agent from the agentset