AB-CE / abce

Agent-based computational Economics, the Python library that makes AB modelling easier
http://abce.readthedocs.io
190 stars 64 forks source link

Purer python #52

Closed rht closed 7 years ago

rht commented 7 years ago

Cleaned and reviewed version of #51.

A round is now executed this way:

simulation = abce.Simulation(processes=processes)

simulation.aggregate('agent', variables=['i', 'r'], possessions=['money'])
simulation.panel('agent', variables=['i', 'r'], possessions=['money'])

agents = simulation.build_agents(Agent, 'agent', 10, parameters='')

for r in range(100):
    simulation.advance_round(r)
    agents.do('go')
    agents.aggregate()
    agents.panel()
simulation.finalize()

With this, custom scheduler can be more easily plugged in, rather than too soldered-in in next_round.