netlogo

NetLogo vs. Repast Simphony?

I would like to simulate some scenarios using the multiagent paradigm, and it seems NetLogo and Repast are the most popular tools for that. I'd like to know if anyone has had any experience with either one and could tell me more about them? For example, I've noticed that there is a fluxogram-like modeling option for Repast, but I belie...

NetLogo: reading data from input files with variable numbers of lines

Hello, I've been running game theory simulations in NetLogo and I now have lots data files, containing cross-tabulated data - each column store a value of a different variable, and there are c. 1000 rows containing the data. I'm trying to write a programme that will take these files and calculate the mean value for each column. I have ...

Netlogo Programming question - Chemical Equilibrium temperature and pressure implementation

Hi I am trying to code something in Netlogo..I am using an existing model Chemical Equilibrium and am trying to implement the following: turtles-own [speed ] ask turtles [ ;; set velocity ( ambient-temperature = 30 ) ;; fd velocity if temp > 40 [ "speed" increases of turtles ] ifelse temperature < 30 [ speed of turtles decrease...

Netlogo programming question - turtle that has no effect on other turtles implementation but speeds up the reaction

Hi I am using an existing model in netlogo called Chemical Equilibrium and am adding some more code I want to add turtles (catalyst) which have no effect on the reaction/other turtles but speeds up the FORWARD reaction. note: forward reaction has been defined as follows to react-forward [t] ask t [ set color red ] set color green rt...

Netlogo programming question - is it possible to put balanced chemical equations in a model?

hi I was wondering if it was possible to put balanced chemical equations, and if possible including state symbols, in the existing netlogo model that i am using, i havenot seen any examples in the models library so was not sure if it was possible. I wanted the model to be able to allow the user to input a balanced chemical equilibrium ...

netlogo programming question - catalyst implementation part 2

hi the catalyst speeds up the reaction but remains unchanged after the reaction has taken place i tried the following code breed [catalysts catalyst] breed [chemical-x chemical-x] ;then the forward reaction is sped up by the existence of catalysts to react-forward let num-catalysts count catalysts ;speed up by num-catalysts...

How to create a maze (labyrinth) in NetLogo?

I am new to NetLogo software and I am trying to create a 5x5 grid with 2 exits and put some walls in it (in other words i want to create a maze or a labyrinth). I was wondering if there is a way to make thicker or change the colour of only the side and not the whole patch. I want to put only one agent inside and let him find the exit b...

NetLogo 4.1 - implementation of a motorway ( Problem creating collision of cars )

Hi there, I am trying to create a simulation of motorway and the behaviour of the drivers in NetLogo. I have some questions that I m struggling to solve. Here is my code: globals [ selected-car ;; the currently selected car average-speed ;; average speed of all the cars look-ahead ] turtles-own [ speed ;; the...

My ifelse statement's result depends on the actions for true/false?

Currently I am building a route for a truck to drive inside my netlogo-land. When the truck is next to the shop-patch where it should deliver, the truck needs to change its actions. However my if or ifelse statement does not seem to respond well and the answer depends on the output. With some tests: *turtles> ifelse ((patch (first di...

Netlogo: error when putting variable in table, only constants allowe??

Hello, Currently I am working on a Netlogo program where I need to use nodes and links for vehicle routing problem. (links are called streets in the program) Here I have some practical problems of how to input variable linkspeed in a table with another node. Constants like 200 etc are fine. Online I found some examples where variables ...

Using the NetLogo API to get turtle coordinates

Hi, I am trying to get coordinates for turtles in NetLogo by using the Java API. I have managed to get the workspace loaded and have been using the following code that I made: public static int getX(HeadlessWorkspace workspace, String playerName, int agentNum) { Double doubleX = null; int xVal = 0; try { xVal ...

Netlogo programming question on traffic simulation

i am working on traffic simulation using Netlogo for my post graduate individual project. when the turtles move forward we can specify the number of units it can move eg: fd 1 . which would mean the turtle moves forward by 1. what is this unit 1. is it equal to 1 patch or equal to the size of the turtle? thanks ...

netlogo programming question

hi i have some basic programming questions in netlogo: *1)*in "is-agent? " command. how can i specifically check if the agent with id = 4 is green or not. is-agent? green ;; this would be true if any of the agents is green. *2)*i have made two breeds of agents and they stop when they collide with each other. how can i make them pass...

Netlogo: line break in output file?? Not so simple.

Dear reader, I tried all options to create a new line in my output file, but still I get a txt-file with everything behind the previous information. Even with this supersimple code: globals [file] to setup clear-all set file "results\GA1.txt" if is-string? file [while [file-exists? file] [set file replace-item (lengt...

netlogo reading and writing to a text file

I want to use a java API in my netlogo program. for that i need to write to a text file and read input from a text file. can this be done in netlogo? one more query is what are the ways by which i can integrate java API with netlogo. ...

netlogo checking patch color

in simple words what I am struggling to do is: if (colour of any patch = red) then execute some code ...

Creating a 50 X 50 grid of patches in NetLogo

hi, I'm new to NetLogo I want to create a specified size of patches (say 50 x 50 grid). Is there any means by which i can set the size of environment ...

netlogo programing help on traffic simulation

i am trying to find if there is a turtle on patch ahead n whos speed - accelaration is <= 0. the code i came up with is: if any? turtles on patch-ahead n with [speed <= (speed - aceleration)] but this gives an error that patch-ahead expects a number, instead got agent set. pleae help how can i do this. n is a number variable. i want ...

netlogo runtime error 'turtles on'

while running the following code if any? (turtles-on patch-ahead q) [ some commands ] where q is a number variable there is a run time error saying: turtles-on expected the input to be agent or agent set but got nothing. what can be wrong. ...

netlogo 1 tick = how many seconds.

how many ticks of simulation (at normal speed) in netlogo is equal to the real world 1 second? ...