Comments (5)
Unfortunately I didn't try this fix. While waiting for a solution for this problem we decided to use another framework. Thanks for your advice.
from agentmet4fof.
Hi! Sorry for the delay. You seem to have customized the code somehow, as the file names and locations seem to differ from the default. Could you please share the content of Tutorial06_changeToMesa.py?
from agentmet4fof.
Hi!
I copied the code from https://agentmet4fof.readthedocs.io/en/latest/agentMET4FOF_tutorials/tutorial_6_mesa_backend.html into a *.py file and tried to run it.
# %load tutorial_6_mesa_backend.py
from agentMET4FOF.agents import AgentNetwork, MonitorAgent, SineGeneratorAgent
from agentMET4FOF.utils import Backend
def demonstrate_mesa_backend():
# Start agent network and specify backend via the corresponding keyword parameter.
_agent_network = AgentNetwork(backend=Backend.MESA)
# Initialize agents by adding them to the agent network.
sine_agent = _agent_network.add_agent(agentType=SineGeneratorAgent)
monitor_agent = _agent_network.add_agent(agentType=MonitorAgent, buffer_size=200)
sine_agent.bind_output(monitor_agent)
# Set all agents states to "Running".
_agent_network.set_running_state()
return _agent_network
if __name__ == "__main__":
demonstrate_mesa_backend()
I also tried to run the tutorial from the tutdorial-dir. I get the same output:
Traceback (most recent call last):
File "D:\Anaconda\envs\Agents\Lib\site-packages\mesa\agent.py", line 53, in __init__
self.model.agents_[type(self)][self] = None
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'agents_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Anaconda\envs\Agents\Lib\site-packages\agentMET4FOF_tutorials\tutorial_6_mesa_backend.py", line 22, in <module>
demonstrate_mesa_backend()
File "D:\Anaconda\envs\Agents\Lib\site-packages\agentMET4FOF_tutorials\tutorial_6_mesa_backend.py", line 8, in demonstrate_mesa_backend
_agent_network = AgentNetwork(backend=Backend.MESA)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda\envs\Agents\Lib\site-packages\agentMET4FOF\network.py", line 597, in __init__
self.start_server_mesa()
File "D:\Anaconda\envs\Agents\Lib\site-packages\agentMET4FOF\network.py", line 688, in start_server_mesa
self._controller = self._AgentController(
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Anaconda\envs\Agents\Lib\site-packages\agentMET4FOF\agents\base_agents.py", line 63, in __init__
MesaAgent.__init__(self, name, mesa_model)
File "D:\Anaconda\envs\Agents\Lib\site-packages\mesa\agent.py", line 56, in __init__
self.model.agents_ = defaultdict(dict)
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'agents_'
from agentmet4fof.
I am so sorry for the long delay. It seems that there arises some compatibility issue from a new release of mesa or some of the current versions of the dependencies. The error is reproducible in our CI environment since two months. I will look into this deeper in two weeks time about, but for now, you should be able ti fix your problem by following these steps:
- Inside of your Python environment (which hopefully is virtual environment exclusively for your agentMET4FOF project) install pip-tools:
$ python -m pip install pip-tools
- Sync your dependencies with the pinned known to work versions from your repository's root folder:
$ python -m piptools sync
This should clear all packages from the environment, which are not mentioned in our requirements.txt file and install otherwise all the packages mentioned in the respective versions.
Then please try again to run the tutorial. Everything should work as expected.
from agentmet4fof.
@DevPy129387 Were you able to try our fix?
from agentmet4fof.
Related Issues (20)
- Properly document input_data_maxlen and output_data_maxlen in metrological_agents
- Include refactoring and performance types in the CONTRIBUTING.md HOT 1
- Provide key facts for the new project homepage in bullet point style HOT 5
- Consider changing server listening on localhost i.e. 127.0.0.1 to listening on all interfaces i.e. 0.0.0.0 HOT 4
- Consider moving tutorials into namespace agentMET4FOF
- Incorporate valuable changes from NPL's code
- Consider including the agentMET4FOF version number in the start up message, that gets printed out on the console
- Labeling of agents HOT 1
- Make sure Mesa does not get tested against naming an agent just with a space HOT 1
- Consider making data sources and generator functions consistent in their default return types
- Improve debugging documentation
- Consider refactoring of AgentMet4FoF to an abstract base class
- Tutorials with OSBrain as backend don't run with PyCharm on Windows HOT 5
- Find a way to log data processing in pipelines
- This site canβt be reached127.0.0.1 refused to connect. HOT 16
- Set data source to handle pd.DataFrame correctly HOT 1
- Incorrect docstring init_agent HOT 3
- Fix _controller instantiation in agent network mode connect=True for osbrain backend
- Consider renaming agentMET4FOF to something more generic HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agentmet4fof.