netlogo

NetLogo - misalignment with imported GIS shapefiles

房东的猫 提交于 2019-12-01 01:10:24
I've got a NetLogo model in which each animal occupies a "territory", wherein all patches that belong to the animal are the same color as the animal. I then use the R extension in NetLogo to create a minimum convex polygon (MCP) surrounding each territory and export those polygons as a shapefile. I then import the GIS file back into NetLogo using the GIS extension. My rationale for this is related to this question I posted before ( NetLogo - applying values to patches within polygons ). That is, I can use gis:intersecting to give a variable to those patches that fall within the GIS-imported

RNetlogo and NetLogo 5.3 error

那年仲夏 提交于 2019-12-01 00:46:35
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(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 2 more > sessionInfo()

How make a list of cumulative sum in netlogo

折月煮酒 提交于 2019-12-01 00:46:11
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 gets a list instead". your code for a cumulative sum works (except that I think you need lput rather

Including a Netlogo source file into another

北城余情 提交于 2019-11-30 20:18:57
How can I include the procedures from one Netlogo file into another? Basically, I want to separate the code of a genetic algorithm from my (quite complicated) fitness function, but, obviously, I want the fitness reporter, which will reside in "fitness.nlogo", to be available in the genetic algorithm code, probably "genetic.nlogo". If it can be done, how are the procedures imported, and the code executed? Is it like Python, where importing a module pretty much executes everything in the module, or like C/C++, where the file is blindly "joined"? This may be a stupid question, but I couldn't find

NetLogo - misalignment with imported GIS shapefiles

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 19:14:15
问题 I've got a NetLogo model in which each animal occupies a "territory", wherein all patches that belong to the animal are the same color as the animal. I then use the R extension in NetLogo to create a minimum convex polygon (MCP) surrounding each territory and export those polygons as a shapefile. I then import the GIS file back into NetLogo using the GIS extension. My rationale for this is related to this question I posted before (NetLogo - applying values to patches within polygons). That is

RNetLogo not working on Mac Yosemite

此生再无相见时 提交于 2019-11-30 16:19:18
问题 I just tried this, but I got this error message. Any ideas about how to fix it? I am using the R version 3.1.1, RNetLogo_1.0-1, the platform is x86_64-apple-darwin13.1.0 (64-bit), Java 7 update 60. Sys.setenv(NOAWT=1) library(JGR) Sys.unsetenv("NOAWT") JGR() library(RNetLogo) nl.path <- "/Applications/NetLogo 5.1.0" NLStart(nl.path) Error in .jnew("nlcon/Preprocess") : java.lang.UnsupportedClassVersionError: nlcon/Preprocess : Unsupported major.minor version 51.0 回答1: You need at least Java 7

Netlogo Sprouting turtles at regular intervals

孤街醉人 提交于 2019-11-30 10:03:02
问题 I want to place turtles on each of the black patches(below Figure) at a specified step size: Therefore if step size less more turtles will be created/sprouted and more step size will result in less turtles. Code I use right now: ask patches with [pcolor = black][sprout-dead-turtles wall-agents [set color red]] This gives the following result: Previous question asked on same lines:Netlogo Sprouting turtles spaced at less than one patch 回答1: Here: to fill-wall [ d ] set d precision d 1 ; make

Time for a procedure to run in NetLogo

安稳与你 提交于 2019-11-30 09:21:59
问题 How can I find the time it took to run a procedure in NetLogo? Using 'ticks' defined in NetLogo is inaccurate for my purposes. A vague idea would to subtract the system time at the start and end of procedure if possible. But I am unaware of any methods defined in NetLogo which would allow me to do this. 回答1: Charles' suggestion of the profiler extension is a great. The profiler extension is incredibly useful. However, it may be overkill for your situation. Checkout reset-timer and timer.

netlogo: how to make turtles stop for a set number of ticks then continue

∥☆過路亽.° 提交于 2019-11-30 09:17:27
问题 I'm trying to create a model where turtles walk randomly (but with a tendency for forward movement) until they land on a yellow coloured patch which represents a baited object. When a turtle lands on one of the yellow patches, I'd like it to stop on that patch and stay there for 15 ticks whilst it 'investigates' the bait. After 15 ticks have elapsed I want the turtles to continue moving as usual until they encounter another yellow patch. I've attempted to modify parts of this parked card

Netlogo: Assign variable using probabilities

左心房为你撑大大i 提交于 2019-11-30 07:30:45
问题 How to assign a string or integer variable to turtle, using probabilities of the variables in a group/list? For example it is 0.4 probability that one specific variable is used from specific group/list. The function selects randomly the variable based on probability. I need to use the same method afterwards to choose a variable (string) from a list according to probability. In python it should be: import random def random_value(probability_list, values): r = random.random() index = 0 while(r