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

Dom and Maya's code combined #3

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Dom and Maya's code combined #3

wants to merge 61 commits into from

Conversation

domdent
Copy link

@domdent domdent commented Jun 30, 2018

No description provided.

firm.py Outdated
import abce
import random

class firm(abce.Agent):
Copy link
Member

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:
Copy link
Member

@DavoudTaghawiNejad DavoudTaghawiNejad Jun 30, 2018

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))
Copy link
Member

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')
Copy link
Member

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.

Copy link
Member

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)
Copy link
Member

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):
Copy link
Member

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())]
Copy link
Member

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():
"""
Copy link
Member

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

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.

3 participants