Questions tagged [netlogo]

NetLogo is an agent-based programming language and integrated modeling environment. NetLogo is free and open source software, under a GPL license. Commercial licenses are also available. It is written in Scala and Java and runs on the Java Virtual Machine.

NetLogo is a multi-agent programmable modeling environment. It is used by tens of thousands of students, teachers and researchers worldwide. It also powers HubNet participatory simulations. It is authored by Uri Wilensky and developed at the CCL. It is free and open source.

4110 questions
6
votes
1 answer

Get all links connecting turtles in a turtle-set efficiently in NetLogo

Given a turtle-set nodes, I want to find all links that have both ends in nodes. The best I've come up with so far is: link-set [ my-links with [ member? other-end nodes ] ] of nodes This does exactly what I want. However, since member? runs in…
Bryan Head
  • 12,360
  • 5
  • 32
  • 50
6
votes
5 answers

How to speed up A* algorithm at large spatial scales?

From http://ccl.northwestern.edu/netlogo/models/community/Astardemo, I coded an A* algorithm by using nodes in a network to define least-cost paths. The code seems to work but it is much too slow when I use it at large spatial scales.My landscape…
Marine
  • 521
  • 1
  • 4
  • 23
6
votes
1 answer

How to remove several items in a list simultaneously

How can I simultaneously remove several items in a list ? I have a list : let list1 map [ -1 * ? ] reverse (n-values ( ( max-pxcor - round (max-pxcor / 3) ) + 1 ) [?]) print list1 [-17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0] For…
Nell
  • 559
  • 4
  • 20
6
votes
1 answer

Implementing reinforcement learning in NetLogo (Learning in multi-agent models)

I am thinking to implement a learning strategy for different types of agents in my model. To be honest, I still do not know what kind of questions should I ask first or where to start. I have two types of agents which I want them to learn by…
6
votes
3 answers

Creating a random shape (blob) of a given area in NetLogo

Is it possible to create random shapes (see below for example) of a given area in NetLogo?
user2359494
  • 731
  • 5
  • 18
6
votes
1 answer

How to create cluster patches that do not overlap between them

I would like to create habitat clusters (e.g. forest patches as in the subject of Marine : Adding patch clusters in a landscape) by controlling the size of clusters and the number of clusters ? For example, I used the code of "plant-migration" : to…
Nell
  • 559
  • 4
  • 20
6
votes
3 answers

NetLogo : How to make sure a variable stays in a defined range?

I have a few variables which can be inherited to child agents by a variation of + 0.1 and -0.1 or without any changes, or random again, What I have done is like this: (The code is just an example) to reproduce ask turtle 1 [ let X-Of-Mother…
Marzy
  • 1,884
  • 16
  • 24
5
votes
0 answers

In NetLogo, how to create turtles on the road downloaded from OpenStreetMap?

I am new to NetLogo and currently I wish to simulate turtles to move on the road. I have downloaded street map from OpenStreetMap and just converted into shapefile (only roads) so that it is compatible for NetLogo. But as I use GIS extension to…
MLest
  • 51
  • 2
5
votes
1 answer

NetLogo: Can the value of a global variable of last two ticks be stored in a list and be called in a procedure?

I want agents to remember the values of that global variable of only last ticks and I want to store them in a list and use it later wherein agents should compare the list items and take a decision for the current tick. I have tried implementing the…
5
votes
2 answers

How to fix "Nothing named ? has been defined" error in NetLogo 6.0.4

I downloaded the modified random clusters code for generating neutral landscape models using the Millington's version of the modified random clusters approach in the NetLogo modeling commons. When I click the "generate-landscape" button, the…
nigus21
  • 337
  • 2
  • 11
5
votes
1 answer

Nothing named ? has been defined

I have small issue with a NetLogo tutorial. I have the following situation: to-report get-best-action let x xcor let y ycor let dir heading let best-action 0 let best-utility -100000 foreach actions[ set heading dir …
Isa
  • 51
  • 2
5
votes
1 answer

Populate NetLogo Chooser at Runtime

I have two "Choosers" in NetLogo. Namely (Category and Sub-Category). The Category Chooser has values ("Animals" and "Birds") and Sub-Category chooser has all the animals and birds in it. I want to populate the Sub-Category Chooser at run time so…
Mirza Bilal
  • 519
  • 1
  • 5
  • 15
5
votes
1 answer

How to share a NetLogo model online

I'm trying to share my NetLogo model online so that it can be run by others on their laptops or smartphones without NetLogo desktop installed. I have found that it is possible to run models online with NetLogo web…
5
votes
2 answers

netlogo convert string to numbers within nested lists

I am transferring between NetLogo and igraph (in R). Some of the information returned from igraph is 2-level nested lists of strings. Typical example looks like: [ ["1" "2" "3"] ["4"] ] I want to convert the internal strings into numbers, while…
JenB
  • 17,620
  • 2
  • 17
  • 45
5
votes
1 answer

Print the elements in an agentset

I want to find the patches which satisfy certain conditions, using the following command: print patches with [ (closest-party = turtle 1) and (distance < 10)] give this as the result: (agentset, 7 patches) how do i find those 7 patches inside that…
Raj
  • 1,049
  • 3
  • 16
  • 30