Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/one_household_one_firm_with_logic/firm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def init(self):
"""
self.create('money', 1000)
self.mygood = "GOOD%i" % self.id # GOOD1 if self.id == 1
self.set_cobb_douglas(self.mygood, 1, {"labor": 1})
self.create_cobb_douglas(self.mygood, 1, {"labor": 1})
self.price = random.random() * 2
self.inventory = 0

Expand Down
8 changes: 2 additions & 6 deletions examples/one_household_one_firm_with_logic/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
timeline.
"""

from abcEconomics import Simulation, gui
from abcEconomics import Simulation
from firm import Firm
from household import Household

Expand All @@ -15,13 +15,8 @@
'rounds': 2500,
'num_firms': 10}

#@gui(parameters)
def main(parameters):
simulation = Simulation(processes=1)
simulation.declare_round_endowment(resource='adult',
units=1,
product='labor')
simulation.declare_perishable(good='labor')

firms = simulation.build_agents(
Firm, 'firm', number=parameters['num_firms'])
Expand All @@ -31,6 +26,7 @@ def main(parameters):
try:
for rnd in range(parameters['rounds']):
simulation.advance_round(rnd)
households.refresh_services('labor', derived_from='adult', units=1)
households.sell_labor()
firms.buy_labor()
firms.production()
Expand Down