Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update one_household_one_firm_with_logic #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update one_household_one_firm_with_logic #10

wants to merge 1 commit into from

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