-
Notifications
You must be signed in to change notification settings - Fork 2
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
Dom and Maya's code combined #3
base: master
Are you sure you want to change the base?
Conversation
…rices and production
firm.py
Outdated
import abce | ||
import random | ||
|
||
class firm(abce.Agent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classes are capitalized
firm.py
Outdated
if self.ideal_num_workers >= self.workers: | ||
self.wage += 1 | ||
elif self.ideal_num_workers == self.workers: | ||
if self.get_messages("max_employees") >= excess*self.ideal_num_workers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.get_messages("max_employees") must be called in any case otherwise there are unread messages.
main.py
Outdated
price_list = list(group_of_firms.getvalue_price()) | ||
demand_list = [] | ||
demand = people.buy_produce(q=find_q(), l=L, firm_price=price_list[v], firm_id=v) | ||
demand_list.append(list(demand)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demand = demand[0], list is not necessary for single value
people.py
Outdated
firm_price = the price the firm is selling the goods for | ||
firm_id = the number of the firm the people are trading with | ||
""" | ||
I = self.not_reserved('money') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should loop in here over all firms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
firms should send their prices with self.send
firm.py
Outdated
buffer = num_days_buffer*self.wage*self.workers | ||
profits = self["money"] - buffer | ||
if profits > 0: | ||
give(person, "money", quantity=profits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.give
main.py
Outdated
print(vacancies_list) | ||
firm_id = group_of_firms.firm_id | ||
print(type(firm_id)) | ||
for v, vacency in enumerate(vacancies_list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this loop should be in the agents, and vacancies should be send as messages.
main.py
Outdated
""" | ||
returns the parameter q as defined in the C-D utility function | ||
""" | ||
q_j = [wage ** (1 / (L-1)) for wage in list(group_of_firms.getvalue_wage())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wage should be price?
main.py
Outdated
|
||
|
||
def find_q(): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should happen in the people agent
… for the farm cycle
42d22cd
to
7512051
Compare
…t the end of each harvest
No description provided.