Questions tagged [netlogo]

1

votes
1

answer
28

Views

What would be a good approach to mutate a turtle variable in NetLogo?

I'm simulating a multi-agent system. Each agent has a chromosome. The genotypes represent 5 parameters that are various floating-point numbers between 0 and 100. My mutation operator simply modifies the original gene with a new random number (according to the constant mutation rate). Is that the bes...
Met
1

votes
1

answer
37

Views

How can I multiply n elements of a matrix by a number in NetLogo?

I have a matrix m and I want to have a user defined function which allows me to control the elements that are multiplied by a value. The function matrix:set-and-report looks promising but I'm not sure how to implement this for multiple elements. For example, I would like to multiply the first 3 ele...
Manassa Mauler
1

votes
1

answer
28

Views

How can I shuffle the order of a matrix in NetLogo?

How can I shuffle the contents of a matrix and preserve it as a matrix? The shuffle function works for lists but not for matrices show shuffle [1 2 3 4 5] 1 2 3 5 4 set m matrix:from-row-list [[1 2 3 4 5]] show shuffle m SHUFFLE expected input to be a list but got the org.nlogo.extensions.matrix.Ma...
Manassa Mauler
1

votes
1

answer
15

Views

Draw a semicircle in Netlogo

I want to create a semicircle, the center of my semicircle is at the end of the world, for example I want that the center of my semicircle is in the 50,20 position, and goes from 20 to -20. I try with this, but I got an exception: The point [ 60 , 20 ] is outside of the boundaries of the world and w...
Liz Lamperouge
1

votes
1

answer
85

Views

plot an item in a list which keeps updating in Netlogo

I defined a set of attributes for some producer agents in the interface as global variables and then assigned them to a list (in the setup) which is also global and the agents will use its content. The problem is that I cannot plot them. Defined in the interface as global variables : p1-size = 9, p2...
user710
1

votes
1

answer
86

Views

Snake game: How to increase the length of a snake body based on the amount of food eaten?

I'm trying to recreate the snake game where the snake eats food and the body increases by 1 unit. However I've tried multiple times to increase the length of the body, but nothing has been working the way I want it to. I tried to create another breed of turtles called 'tails' and hatch it behind the...
Sam
1

votes
2

answer
55

Views

Assistance with Node/link navigation in Netlogo

I am new to netlogo and developing a model that incorporates floor plans in which agents essentially evacuate the building avoiding obstacles etc. I have set up my model so that a node sprouts on every patch within the building, and by modifying an example i found on here by Luke C i have programmed...
displayName
1

votes
2

answer
146

Views

Is there a way to stop a timer in Netlogo?

If you make a timer in Netlogo, is there a way to stop it?
Kasey Chan
1

votes
0

answer
75

Views

Netlogo: create small-world network while running

I'm trying to generate a small-world type of network (https://en.wikipedia.org/wiki/Small-world_network) in my Netlogo model which is created throughout the model itself; people get to know one another while the model is running. I know how to generate a small world model in Netlogo in the setup. B...
maria118code
1

votes
0

answer
49

Views

A better way to have R wait on NetLogo with RNetLogo package

I have a model that has some commands that seem to take longer than R is willing to wait. I have resorted to inserting a Sys.sleep in R. Is there a better way? There are not any natural reporters to use a dowhile. For example, I will call a command where my turtles go through a process of claiming t...
jjhold
1

votes
0

answer
42

Views

r extension netlogo, object 'economicvalue' not found

I am working in netlogo on a model which has to communicate with R during the run. I do this using the r extension in netlogo (so not Rnetlogo in R). at the setup I load my script with r:eval 'source('C:/Users/keemi/OneDrive/Documenten/Thesis/heatpumps/scriptHeatpumpV1.R')' this works fine since I...
Wessel K
1

votes
0

answer
141

Views

Netlogo ERROR - DISTANCE expected input to be an agent but got the number 0 instead

I am trying to create home ranges for 3 types of hosts for a model that aims to simulate the movement of ticks across a landscape based on the presence of three host-types. Using some code that was described in a previous post I created the following code. When I run the model I eventually get the...
JRF89
1

votes
1

answer
112

Views

Dynamic scoping of self and myself in NetLogo?

When I run this code: to myself1 create-turtles 1 let a 'a' ask turtle 0 [ show a show self ask patch-here [ show a show self show myself ] ] end I get this output: (turtle 0): 'a' (turtle 0): (turtle 0) (patch 0 0): 'a' (patch 0 0): (patch 0 0) (patch 0 0): (turtle 0) So inside the ask patch code...
RussAbbott
1

votes
1

answer
61

Views

How to recognize when a forever button is released in NetLogo

Is there a way for the code in a forever button to recognize that the button was released? I would like to terminate the button's operations cleanly when the user wants it to stop. I realize that when a forever button is released, its code completes, but that doesn't tell me whether it will repeat a...
RussAbbott
1

votes
0

answer
39

Views

Why must `report` occur at the top level of a NetLogo procedure?

I wanted to write something like this. to-report a-new-agent crt 1 [ report self ] end But that triggers a compiler error message: report must be immediately inside a to-report. So I'm forced into something like this. to-report a-new-agent let new-agent nobody crt 1 [ set new-agent self ] report...
RussAbbott
1

votes
1

answer
28

Views

How to give the keyboard focus in NetLogo

It's possible to designate a key as associated with a NetLogo button. But the key-press will not activate the button unless the keyboard is in the appropriate state. (I'm not sure what to call that state.) For example, when one starts a model, keys do not activate buttons until one clicks the backgr...
RussAbbott
1

votes
0

answer
95

Views

Why can't this code be run by the observer in NetLogo

When I run code that looks like this: ask an-agent [set a-field (turtle-set n-values []) I get this run-time error message this code can't be run by a turtle, only the observer error while an-agent running SET But when I write it like this: let a-value (turtle-set n-values []) ask an-agent [set a...
RussAbbott
1

votes
0

answer
35

Views

Driving simulation:overtaking, im having an issue with lane changing in my netlogo

In my project i am writing a semi-autonomous car simulation, as a beginner i have used a basic version of a driving simulation and aiming to expand it, whist expanding the coding i was trying to mimic lane centring, so have made each lane or a road three patches thick, in doing so i'm struggling to...
Tom Best
1

votes
0

answer
54

Views

Correlation function in NetLogo

I would like to compute the spatial correlation length of a patch variable. Normally I would do it by taking the integral of the correlation function of that variable, but how to compute such a function with NetLogo? Since I my project deals with periodic 2d world, I could use FFT transform to comp...
Enrico Calzavarini
1

votes
0

answer
63

Views

Creating standalone executable from a NetLogo model

I have a NetLogo model. I want to have a standalone executable with the same/similar interface and behavior. I want the user to be able to run my model without downloading/installing NetLogo first. Is there a way to do this? Or is there a programming language or framework to which I can easily trans...
Muhammad Nizami
1

votes
0

answer
102

Views

- / + random-float give a changing and a fixed number in netlogo

Hi folks I want my patch variable WTD to increase by the amount in turtle context in procedure watering-decisions . But if I write minus (-) random-float it get changed. Showed constant value otherwise. Pls, help. globals [TW well-depth] Breed [farmers farmer] farmers-own [ WA sw FW WR dws Logging...
Sadaf
1

votes
0

answer
48

Views

How can I find a memory leak in NetLogo

My current model seems to have a memory leak. The task manager (on Windows 10) shows the amount of memory used slowly creeping upwards. I have a fixed number of agents (about 70) and no links. I can't think of any place where a list grows without bounds. I do a lot of replacements in lists, using t...
RussAbbott
1

votes
0

answer
42

Views

PIxel size of raster changes when exporting it from NetLogo

I have a raster with a resolution of 220m that I import into NetLogo and then export with some results in each cell. However, on exporting, the pixel size changes to somewhere between 219 and 220 m, with the result that there is a slight misalignment when placing it on other layers. Is there a fix f...
Anisha Jayadevan
1

votes
0

answer
54

Views

layout turtles using link weight

I am trying to layout my turtles taking into account the link weights, but it looks like no primitives are using link attributes. In my case links can have weights from -3 to 3, and the ideal visualization will push together (or pull away) turtles with a force proportional to their link weight. Is...
user299791
1

votes
0

answer
17

Views

Dividing household keeping individuals with link together

I am programming for the first time in netlogo, so I am have a bit of difficulty. I am trying to simulate an indigenous community focusing on decisions regard time allocation to different productive activities (farming and hunting). In the whole model there will be demographic processes (reproductio...
Pris Cunha
1

votes
0

answer
24

Views

overtaking scenario how can i make one car over take another?

in the case of two lanes on a road, in real life you can only over taking by moving from the outside lane to the inside lane then once the car is passed return to the outside lane, in the case of net logo i have it set out that a car will check the patch set in front and to the left of them to see i...
Tom Best
1

votes
0

answer
47

Views

Netlogo: How to build connections between turtles conditional on their variables being in the same list?

I am trying to build a network model in NetLogo. Each turtle has a generation g and she has a child who belongs to generation g+1 and a parent who belongs to generation g-1. Each turtle has a variable called parent which is equal to turtle who + N , N is the number of turtles in a generation. So for...
1

votes
1

answer
51

Views

Generating K-multisets when order matters and repetition is allowed

Sorry if my question is basic but I have not coded in the past 15 years although I am trying to learn to code again for a research project. I have a set of 12 objects [A B C D E F G H I J K L] and I want to create a list of any possible K-multiset for any K between 1 and 6. (I do have a list of sele...
MoResearch
1

votes
0

answer
314

Views

Netlogo file open error “expected nlogo file to have 12 sections, this has 1”

I'm getting the error expected nlogo file to have 12 sections, this has 1. I understand that a file has 12 sections, but I don't know what that means or why my model all of the sudden has one. I know that the sections are as follows: Code tab @#$#@#$#@ Interface tab @#$#@#$#@ Info tab @#$#@#$#@ t...
aaronjwenger
1

votes
0

answer
30

Views

Revolution Enterprise R for windows 7.1.0 married to Netlogo 6.0.2

I preface by saying I don't have administrator-privileges on my desktop PC & my employer is security paranoid (blame Climate-gate). I can't change that, be glad it's my problem not yours. Thanks in advance if anyone can help. Working Netlogo 6.0.2 and Rev. Revolution vers. 7 are on desktop at pres...
1

votes
0

answer
44

Views

NetLogo issues on Windows 10

I am running NetLogo 6.0.2 on a Windows PC with a recently updated windows 10 OS. Prior to the update I had a model, I have developed for my research, running perfectly fine. Since the update, Netlogo is no longer able to recognise file pathways I have in place for calling in data needed for the mod...
Tom O'Shea
1

votes
0

answer
23

Views

Can a netlogo program take in real-time inputs from an external source?

Netlogo seems like a fantastic way to model complex systems. However, it is used primarily as a research and education tool. As a rather fun, speculative idea, I was wondering if you could hook up a netlogo model to a sensor or some other program, and have the former take inputs from the latter in r...
Joebevo
1

votes
0

answer
28

Views

Error in Tabonuco-Yagrumo-Hybrid Netlogo model?

I am working through how Netlogo's Tabonuco-Yagrumo-Hybrid model (http://ccl.northwestern.edu/netlogo/models/TabonucoYagrumoHybrid) integrates system dynamics and agent-based modelling. As I understand it, the model replaces the traditional 'flows' in a system dynamics model with an agent-based proc...
user_15
1

votes
0

answer
72

Views

Netlogo Landuse Change modeling creating iterations

I'm using netlogo for a school project. This is the first time that I'm using netlogo and I'm running into some problems. For example I want to calculate a patch 'willingness to change' based on is they are with enough fellow patches according to a senario. I now wrote this: Ask patches [ if coun...
Roos de Boer
1

votes
1

answer
30

Views

How to create links in netlogo from ArcGIS shapefile

I have successfully loaded other ArcGIS shapefiles e.g., river polygon.However I am trying to draw/ create links by loading a polyline shapefile. Here is an extract of the code. set river_area gis:load-dataset 'River_data/April_28_2018_800m_Lines.shp' set river_zones gis:load-dataset 'River_data/May...
Unmesh Kanchan
1

votes
0

answer
19

Views

Seed dispersal around a tree provokes an infinite loop?

I've just started a project in which I intend to simulate (among other things) the seed dispersal around trees (named zsps). Neighboring patches can already be settled or unable for seeding due to low fertility. I wrote code that runs (at the begining of simulation) but that made the code enter into...
PatrickC
1

votes
0

answer
39

Views

Netlogo barriers, walls, and drawn lines narrower than a patch

I'm working on a model of an event in a specific building. I have the floorplan. There's one issue: the building is large enough that if I make the walls take up a whole patch, making them easy to factor into pathfinding, the model is too large to run. So I have them narrower, and am treating them a...
Chiomi
1

votes
0

answer
60

Views

Calculating with ascii maps in Netlogo

I have two ASCII files that contain cell values from a raster grid (map1 & map2). Is it possible in Netlogo to create a third map (map3) by calculating the cell values of map1 with those of map2? (like some kind of raster overlay or raster calculator). The output map (map3) would be a product of the...
Kili
1

votes
0

answer
134

Views

Importing CSV file in NetLogo

I'm a new user of NetLogo and I'm trying to import the CSV format file in NetLogo. this is the geometry of a plan in Revit but unfortunately, I couldn't.the name of my file is Window.csv, and I tried different methods from this website and NetLogo dictionary. I used NetLogo Extension: set filename ...
Sina
1

votes
0

answer
26

Views

Loading NetLogo headless with Rscript on Linux cluster error

I am running Netlogo on Linux system cluster (big computer), and i am using the old version Netlogo-5.2.0, with R version 3.5 and its RPackages (RNetLogo-1.0-1 and rJava, which are compatible with Netlogo-5.2.0). When i am using the command NLStart(nl.path, gui=F, nl.obj=my.netlogo1) #Creates an ins...
Shanghua Li

View additional questions