Questions tagged [mesa-abm]
27 questions
2
votes
2 answers
python: Run mesa simulation - how to save results of each run?
I am using this mesa framework which has two main files: model.py and server.py. The simulation as built runs exactly once but I would like to run it several times ex 5 times but save the values for each run. I am using the command line to run the…

ithoughtso
- 103
- 8
2
votes
2 answers
Deleting agent in MESA
I am using MESA to simulate COVID-19 spread. I want to delete agent that dead but when I run it on the web, the agents never decrease even I set the death rate to 100%.
def condition(self):
self.Infection_time +=1
if self.Infection_time <=…

Cheng Zheng
- 21
- 2
1
vote
1 answer
Python Mesa Advanced Tutorial - Error Launching Server
Hi am new to python and agent based modelling.
Am following the mesa advanced tutorial and getting a NotImplementedError when running the visualisation code.
I previously followed the introductory tutorial and successfully created the MoneyAgent…

StackRooster
- 11
- 1
1
vote
0 answers
How can I speed up assigning numpy array values to objects (agents) in Mesa
I am using mesa (agent based modelling) to implement a landscape model. To generate the landscape I utilize several numpy arrays (800 x 800) that each hold specific information (e.g. elevation, soil moisture etc etc). To initialize the model, Mesa…

user13254592
- 11
- 1
1
vote
1 answer
Importing agents and their attributes from CSV in mesa
My data is in .csv format and each row of data represents each agent while each column represents a certain attribute.
My question is how to assign agents and their attributes from a csv file in Mesa?
Could anyone help me with how to import them…

Mo Pa
- 11
- 2
1
vote
1 answer
Is there anyway to define subagents in a multiagent system while using Mesa library in Python?
I'm trying to write a multiagent system in python using the Mesa library, and while the library has been great for a beginner like me(unlike something like Spade, which I found too complex), I can't figure out how I would define subagents using the…

Hamza Waheed
- 139
- 2
- 10
0
votes
1 answer
How to solve import error from mesa.visualization.UserParam?
Import error: cannot import name 'UserSettableParameter' from 'mesa.visualization.UserParam'
pip list
error
error
I Checked Conda list and pip list, both of them have mesa installed and tried several times to installed and uninstalled mesa, but…

Chichi22
- 1
- 1
0
votes
1 answer
mesa agents not work the function that put in Class Agents
I try to put an function for the calcule of the venta "self.venta += 10" to verifique the model, but the result not change.
Someone can help me! thanks.
class MoneyAgent(mesa.Agent):
def __init__(self, unique_id, model,row):
…

WHR
- 1
0
votes
1 answer
Unable to use "ctrl + c" to close a port used for visualization opened through python MESA on Mac OS
This is the code I am using to run a visualization using python MESA. However, as per the tutorial, I should be able to stop the vizualization window using "ctrl + c" in the terminal but that dosen't work.
This is a snip of the vizualization opened…
0
votes
1 answer
Coding Moral Worth
I am a beginner programmer and currently trying to code moral worth in the context of a public good game with cooperators, deceptors, and peer-punishers.
To start, I wanted to start simple and associate being a cooperator and a peer-punisher with +1…

Joca97
- 3
- 3
0
votes
0 answers
Can I automate the assignment of attributes to agents in MESA without having to manually name each attribute?
I have a set of attributes (in form of a dataframe). Columns representing agents and rows representing attributes. Not all agents have all attributes, which means I can't manually name and assign the attributes or it'll be messy and hard to…
0
votes
0 answers
Agent based modelling for covid with mesa python
before that I was a new user in python, I really didn't understand Python, especially in Mesa, while my final assignment was about agent based models for covid 19 in Python, any suggestions where I can start learning agent-based models really for…
0
votes
1 answer
How can I make it so agents only perform action during a certain time step in mesa (python)?
I'm trying to create an agent-based model using the mesa python framework. I want my agents to reproduce only on certain days of the year. Specifically, on days 203 through 209. Here is my model so far:
import mesa
import random
#set up class for…

ifoxfoot
- 195
- 7
0
votes
0 answers
how to get agent neighbors in python?
can anyone help me?
`
class MyAgent(Agent):
def __init__(self, unique_id,pos, model):
super().__init__(unique_id, model)
self.unique_id = unique_id
self.pos = pos
self.state = State.Not_adopter
self.RA =…
0
votes
0 answers
how to placing agent in singlegrid and determine numbers of neighbors with python?
I would like to implement an agent-based model, and for that, I need a function that allows me to place an agent in a grid according to a specific condition, otherwise, according to a condition (x) I decide the number of neighbors of an agent, the…