netlogo

Determining the radius of turtle clusters and number of turtles in them - postprocessing

只愿长相守 提交于 2019-12-11 04:54:02
问题 If I have a situation in which about a 1000 black turtles disperse at random angles and steps throughout the netlogo world for a given duration of ticks. Each turtle is assigned a random probability at each timestep during dispersal, and if this number exceeds a given threshold for any given turtle it changes it's color to red and stops moving. Additionally, black turtles (still moving) that happen to move within a patch of red turtles (stopped/settled), change their color to grey and settle

Drawing an Emergent ellipse with a turtle.

筅森魡賤 提交于 2019-12-11 04:45:02
问题 This is an answer to a question posed in the comments in my possibly poorly worded question about super-ellipses. in Netlogo it is natural to draw geometric shapes in ways that may seem strange in other languages. ask turtle 1 [pendown let d (pi * distance turtle 2) / 360 repeat 360 [face turtle 2 rt 90 fd d] ] for instance inscribes makes turtle 1 draw a circle [360-gon] around turtle 2. I did not invoke any of the standard circle formulas but still get a circle. Is it possible to draw an

Netlogo: Set specific setxy patern with set number of turtles?

假装没事ソ 提交于 2019-12-11 04:39:57
问题 Is it possible to create a set number of turtles, from a file, to have their own patches? Like always be in the same location? I've got 106 turtles I'm reading in from a file and I was hoping to have them be created on their own patches, like a square latice kind of thing. I want to be able to look at the model world and easily identify a turtle. file-open "turtledata_A.txt" show file-read-line while [not file-at-end?] [ set param read-from-string (word "[" file-read-line "]") create-turtles

Netlogo: How using the route variable to actually move along the path

a 夏天 提交于 2019-12-11 04:25:55
问题 I use two types of turtles, cars and houses. both are randomly positioned. My goal is to get a route for each car starting from a combined route vector, and have each car move and visit every home that has been assigned to it. First i create a route for each car from the combined route vector. I present my code below. But now, im trying make car follow respective route... globals [ route-vector ] breed [carr car] breed [hous housess] carr-own [ route ] to setup clear-all create-carros create

Multiple behavior spaces

≡放荡痞女 提交于 2019-12-11 03:58:50
问题 I have a simulation with no global values. Instead the two things that are changed between experiments are the breeds being used, and the number of ticks in the setup (how many turns before the behavior space starts recording results) Currently I'm duplicating each behaviour space and making the minor changes, is there a better way to do this so that I can program all the behavior spaces runs at once? 回答1: There are many different ways to do this, but since you don't give us a lot of

Spacing agents in NetLogo based on territory size

爱⌒轻易说出口 提交于 2019-12-11 03:47:19
问题 I'm trying to develop a model in NetLogo in which animal agents will be randomly distributed across space each time the model is started. However, the animals are territorial. Any suggestions on how to have the animals start with a circular territory of some size that can overlap with other animals to a certain extent but not completely? Below is the fragment of code I have started on it, but frankly I don't even know where to start. In the code below the animals aren't aware of the other

Memory: storing patch variables in table for multiple patches

微笑、不失礼 提交于 2019-12-11 03:33:49
问题 I am creating turtle-specific tables in which to store patch coordinates, year of simulation (global variable set to 1, 2, or 3 depending on tick count), and a patch variable representing available resources. I have managed to code for the creation of a table that has these values for the current patch but am stuck trying to scale this so that, at each time step, the turtle stores these three things for all its neighboring patches. The code that seems to be working for the current patch is:

How to avoid individual patch updates

泄露秘密 提交于 2019-12-11 03:21:55
问题 I am modeling diffusion in my model, but I think I am getting a calculation artifact due to NetLogo sequentially updating individual patches. I will not be using the diffuse command (due to inaccurate diffusion). However, much like how this command works, I would like to update all the calculations of the patches simultaneously, rather than sequentially. I have a slight recollection of seeing some sample code that used values at the beginning of the tick , however I can´t seem to find it now.

In-Cone only works for patch centers Netlogo

余生长醉 提交于 2019-12-11 02:53:47
问题 I'm having some issues with the in-cone command in Netlogo. I am trying to identify the sum / mean of all the patch variables directly in front of my turtles current location (ie the sum of all the variables it crosses). However, this only appears to be working when my turtle is at the center of a patch (co-ordinates are integers not decimals), which also means I can only move my turtles at right angles. I'm yet to find any other questions pertaining to the same issue on Stackoverflow or

Running NetLogo simulation in parallel from R

佐手、 提交于 2019-12-11 02:44:30
问题 How would it be possible to run the following the NetLogo simulations in parallel. library(RNetLogo) path.to.NetLogo <- "C:/Program Files (x86)/NetLogo 5.1.0" #change this path to your Netlogo directory NLStart(path.to.NetLogo, nl.version=5) #open specific model from NetLogo then. while(i < 0.123) { NLCommand("set beta-exit", i) NLCommand("setup"); a=NLReport("count inboxturtles with [exit = true]"); NLCommand ("go"); e=((NLReport("total-time"))/a) i=i+0.009; } Consider that, this statement: