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
5
votes
1 answer

Why does an Agentset button behave different than an observer button asking the agentset?

I see a behavior difference between an agentset button (patch, turtle, link) which runs a certain section of code and an observer button which asks patches (or turtles, or links) to run the same section of code. Is this a bug in NetLogo? Is this a…
Robert Grider
  • 261
  • 1
  • 7
5
votes
1 answer

How to output a graph in netlogo

How do I output a plot as a PNG file in Netlogo please? I don't mean the data that created the plot, which is export-plot, but the picture. I can do a screen shot but it seems like there might be a better way.
ThomasC
  • 861
  • 6
  • 12
5
votes
1 answer

Netlogo while loop only one time

I have a small problem in Netlogo, which I began to work on only a few days ago, I try to make a maze with two adventurers, and I make them go from two different starting locations, to one final location. All the beginning of my code works fine, to…
O. L
  • 53
  • 1
  • 4
5
votes
1 answer

NetLogo Efficiently create network with arbitrary degree distribution

This is a follow up question to NetLogo Efficient way to create fixed number of links. Having focussed on avoiding the nested `ask', I now have this code. It is much more efficient, but is creating too many links. Clearly a logic error but I can't…
JenB
  • 17,620
  • 2
  • 17
  • 45
5
votes
2 answers

NetLogo Efficient way to create fixed number of links

I have about 5000 agents (people) in my model. I want to give them an arbitrary number of friends and have reciprocal but random pairing. So if person A chooses person B then person B also chooses person A. My code works fine, but is fairly slow. I…
JenB
  • 17,620
  • 2
  • 17
  • 45
5
votes
2 answers

if elseif else implementation in Netlogo environment

I wish - if elseif else statement in NetLogo. How can I do so efficiently? I checked NetLogo documentation no command to do so. Previous similar question didn't answer it directly but solved in the context. One simple solution is: let flag…
Abhishek Bhatia
  • 9,404
  • 26
  • 87
  • 142
5
votes
1 answer

Development of turtles from one breed to another

I dont know much about netlogo so this may be a really simple solution but I have multiple breeds of turtles where each breed is a different age range (eggs, hatchlings, juveniles, hawksbills (adults)) and i need them to be able to go from one breed…
Dana
  • 97
  • 7
5
votes
3 answers

Netlogo , How to display number of ticks

Hi I am writing simulation which uses ticks to represent time in simulation environment . Is it possible to display tick counter in monitor GUI? Also I have tried to input the code but it is not working. My sample code: if [agents count = 0] show…
Prit Tuntisak
  • 51
  • 1
  • 3
5
votes
2 answers

How can I count dead turtles in Netlogo

I would like to know the numbers of all turtles died in my pseudo model. How can I do that? I would appreciate very much a simply and fast running solution for that problem, like count dead turtles. I was thinking of a routine like this (but do not…
Til Hund
  • 1,543
  • 5
  • 21
  • 37
5
votes
2 answers

How to read a .CSV file with netlogo?

I'm starting in netlogo these days, so I've got some problems that I didn't find how to solve them. I have to read a huge .csv file, got this code on the web: to openFile file-open "testeCsv.csv" set csv file-read-line set csv word csv "," ;…
5
votes
1 answer

How to create a list containing numbers from 1 to given number in NetLogo?

Does anyone know how to create a list containing numbers from 1 to given number in NetLogo? It looks like [1 2 ... given number] thanks!
user3765587
  • 525
  • 1
  • 4
  • 7
5
votes
1 answer

NetLogo get the breed of a turtle

i am trying to randomly pick 2 turtles of the same breed - but i´m struggling with how to do it. I have 10 different breeds. My code should first randomly pick a turtle of any breed and then pick randomly one of the same breed than the first one.…
user3005072
  • 159
  • 9
5
votes
2 answers

NetLogo histogram showing up as a line instead of bars

I have created a histogram of a variable in my model in NetLogo 5.0.5, but the histogram keeps showing a line rather than bars I want. I'm using the set-histogram-num-bars n in the pot set up areas, but nothing is changing. In the histogram…
Simon Bush
  • 407
  • 2
  • 9
5
votes
2 answers

The path does not reach the end node in my A* algorithm

Following on from How to speed up least-cost path model at large spatial extents, I tried to code an A* algorithm in Netlogo to increase my least-cost path model at large spatial extents. Here is my code: to findPath [ID-start-node ID-end-node] …
Marine
  • 521
  • 1
  • 4
  • 23
5
votes
1 answer

NetLogo: Finding the average value of a set of turtles

I'm trying to implement a monitor in the user interface that displays the average value of a variable shared by a breed of turtles (turtles own). Does anyone know of a method of collecting all the values, adding them together and dividing by the…
algorhythm
  • 3,304
  • 6
  • 36
  • 56