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

purchase_cost calculation #26

Open
ChrisKahrs opened this issue Jun 20, 2022 · 1 comment
Open

purchase_cost calculation #26

ChrisKahrs opened this issue Jun 20, 2022 · 1 comment

Comments

@ChrisKahrs
Copy link

ChrisKahrs commented Jun 20, 2022

In the NewsVendor.py file... I don't think "excess_inventory" should be in the calculation for "purchase_cost". It is handled in the "holding_cost" section and it messes up the calculations for everything else in purchase costs for new items. Am I incorrect? I took it out and everything now seems to be working ok. I will do a fix and pr if you believe this is also correct. Thanks!

Line 84 (newsvendor.py)
excess_inventory = max(0, inv_on_hand - demand)
short_inventory = max(0, demand - inv_on_hand)
purchase_cost = excess_inventory * self.cost * order_qty *
self.gamma ** self.lead_time
holding_cost = excess_inventory * self.h
lost_sales_penalty = short_inventory * self.k

@osarwar
Copy link
Collaborator

osarwar commented Sep 1, 2022

Hey @ChrisKahrs, thanks for pointing this out! I'd love a PR if you can manage it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants