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

Clean up edge cases in calculating share fraction in sim._raw_materials_to_finished_goods() #156

Open
LarrySnyder opened this issue May 10, 2024 · 0 comments
Assignees
Labels
coming soon Plan to do this in a not-too-distant release enhancement New feature or request

Comments

@LarrySnyder
Copy link
Owner

# If units_ordered == 0, allocate into equal shares. (This can happen if the original
# order was backordered, or if there is initial RM at the start of the simulation.)
# TODO: allocate in a smarter way in this case?
if units_ordered == 0:
share_frac = {prod_index: 1 / len(prods_for_rm) for prod_index in prods_for_rm}
else:
# TODO: what if order_quantity_fg = 0 (e.g., because of backorders)?
share_frac = {prod_index: node.state_vars[period - OLT - SLT].order_quantity_fg[prod_index] \
* node.NBOM(product=prod_index, predecessor=None, raw_material=rm_index) \
/ units_ordered for prod_index in prods_for_rm}

Allocate in a smarter way if units_ordered == 0?

Better handling for case where order_quantity_fg == 0 (e.g., because of backorders)?

@LarrySnyder LarrySnyder self-assigned this May 10, 2024
@LarrySnyder LarrySnyder added enhancement New feature or request coming soon Plan to do this in a not-too-distant release labels May 10, 2024
LarrySnyder added a commit that referenced this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coming soon Plan to do this in a not-too-distant release enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant