agent-based-modeling

Is NetLogo too slow for big simulations? How can I speed up a NetLogo model?

青春壹個敷衍的年華 提交于 2019-12-03 14:02:29
Is NetLogo a good platform for big models (>10,000s of patches, turtles)? How can I speed up a model that runs very slowly? We just published an article on execution speed of NetLogo; it is available at: http://jasss.soc.surrey.ac.uk/20/1/3.html The article's main points are (a) NetLogo is not necessarily slow for executing large scientific models, and in fact has speed advantages over some alternatives; and (b) NetLogo models do often execute very slowly at first but can almost always be sped up dramatically by using a few basic techniques. We provide a step-by-step strategy for measuring and

agent-based simulation: performance issue: Python vs NetLogo & Repast

五迷三道 提交于 2019-12-03 09:21:26
问题 I'm replicating a small piece of Sugarscape agent simulation model in Python 3. I found the performance of my code is ~3 times slower than that of NetLogo. Is it likely the problem with my code, or can it be the inherent limitation of Python? Obviously, this is just a fragment of the code, but that's where Python spends two-thirds of the run-time. I hope if I wrote something really inefficient it might show up in this fragment: UP = (0, -1) RIGHT = (1, 0) DOWN = (0, 1) LEFT = (-1, 0) all

agent-based simulation: performance issue: Python vs NetLogo & Repast

那年仲夏 提交于 2019-12-02 23:34:50
I'm replicating a small piece of Sugarscape agent simulation model in Python 3. I found the performance of my code is ~3 times slower than that of NetLogo. Is it likely the problem with my code, or can it be the inherent limitation of Python? Obviously, this is just a fragment of the code, but that's where Python spends two-thirds of the run-time. I hope if I wrote something really inefficient it might show up in this fragment: UP = (0, -1) RIGHT = (1, 0) DOWN = (0, 1) LEFT = (-1, 0) all_directions = [UP, DOWN, RIGHT, LEFT] # point is just a tuple (x, y) def look_around(self): max_sugar_point

Agent-based modeling resources [closed]

核能气质少年 提交于 2019-12-02 18:16:36
I would like to know what kind of toolkits, languages, libraries exist for agent-based modeling and what are the pros/cons of them? Some examples of what I am thinking of are Swarm , Repast , and MASS . darlinton I found a survey from June 2009 that answer your question: Survey of Agent Based Modelling and Simulation Tools Au. R.J. Allan Abstract Agent Based Modelling and Simulation is a computationally demanding technique based on discrete event simulation and having its origins in genetic algorithms. It is a powerful technique for simulating dynamic complex systems and observing “emergent”

Using to-reports while creating agents from a csv file

倖福魔咒の 提交于 2019-12-02 12:12:54
问题 My question is a bit long. I really appreciate it if you could please read it all and I'd be very grateful for any piece of advice. I have data related to 2 consumers as turtles who have rated laptops' features. The laptops have 2 kinds of features : size of the screen and battery life. Each has some levels. For example battery life has 5 hours, 12 hours, 24 hours, 30 hours. Data is stored in a csv file. 12 13.5 14 15 5 12 24 30 1 1 2 1 3 2 2 4 5 2 4 3 1 2 1 1 2 3 I want to sum the rates of 2

NETLOGO: Using variable from previous tick

天涯浪子 提交于 2019-12-02 10:40:01
问题 is there some primitive for using value of variable from previous tick? I tried to compute variable of "price" for one agent and I mean to use formula which includes other agents' "price" variable but from previous tick. 回答1: No, there is no built-in way to do this in NetLogo. Your best bet would probably be to create a variable called something along the lines of varname-last-tick and then updating that as the last thing you do in the go procedure of these agents. It sounds like the variable

How make a list of cumulative sum in netlogo

折月煮酒 提交于 2019-12-01 00:46:11
How can i make a list of cumulative sum of a other list? i tried it that way: ;;all temperatrue-values around the turtle saved in list set temperature_values (list [(output-heat + 1)^ Freedom] of neighbors) ;;build cumulative value of temperatures and put each value in list let tempsum 0 set tempsum_list [] foreach temperature_values [set tempsum (tempsum + ? ) set tempsum_list fput tempsum tempsum_list ] but it doesn't work. can anyone fix this problem? it says that "+ excepted a input but gets a list instead". your code for a cumulative sum works (except that I think you need lput rather

Fixing set.seed for an entire session

我怕爱的太早我们不能终老 提交于 2019-11-29 01:10:28
I am using R to construct an agent based model with a monte carlo process. This means I got many functions that use a random engine of some kind. In order to get reproducible results, I must fix the seed. But, as far as I understand, I must set the seed before every random draw or sample. This is a real pain in the neck. Is there a way to fix the seed? set.seed(123) print(sample(1:10,3)) # [1] 3 8 4 print(sample(1:10,3)) # [1] 9 10 1 set.seed(123) print(sample(1:10,3)) # [1] 3 8 4 There are several options, depending on your exact needs. I suspect the first option, the simplest is not

Fixing set.seed for an entire session

对着背影说爱祢 提交于 2019-11-27 15:39:15
问题 I am using R to construct an agent based model with a monte carlo process. This means I got many functions that use a random engine of some kind. In order to get reproducible results, I must fix the seed. But, as far as I understand, I must set the seed before every random draw or sample. This is a real pain in the neck. Is there a way to fix the seed? set.seed(123) print(sample(1:10,3)) # [1] 3 8 4 print(sample(1:10,3)) # [1] 9 10 1 set.seed(123) print(sample(1:10,3)) # [1] 3 8 4 回答1: There