Skip to content

Conversation

rht
Copy link
Member

@rht rht commented Jul 14, 2020

This still have a remaining error

Traceback (most recent call last):
  File "start.py", line 48, in <module>
    main(parameters)
  File "start.py", line 23, in main
    households = simulation.build_agents(
  File "/home/rht/code/venv/lib/python3.8/site-packages/abcEconomics/__init__.py", line 311, in build_agents
    group.create_agents(AgentClass, agent_parameters=agent_parameters, **parameters)
  File "/home/rht/code/venv/lib/python3.8/site-packages/abcEconomics/group.py", line 209, in create_agents
    new_names = self._scheduler.add_agents(Agent, common_parameters, agent_parameters, self._agent_arguments, self.num_agents)
  File "/home/rht/code/venv/lib/python3.8/site-packages/abcEconomics/scheduler/singleprocess.py", line 38, in add_agents
    agent.init(**ChainMap(simulation_parameters, ap))
TypeError: init() got an unexpected keyword argument 'parameters'

@DavoudTaghawiNejad ?

@shaaanya
Copy link

shaaanya commented Aug 1, 2022

This issue still exists.
More specifically in example with one firm and one household, when we create household in main() function it calls simulation.build_agents(), which, according to declaration of class Simulation (link) declared as following:
def build_agents(self, AgentClass, group_name, number=None, agent_parameters=None, **parameters):

In example, it's called as:
households = simulation.build_agents( Household, 'household', number=1, parameters=parameters).

@rht
Copy link
Member Author

rht commented Aug 1, 2022

I think I will re-implement the examples with Mesa's StagedActivation. abcEconomics' scheduler is too complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants