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

Applies TotalInvTracker and (R,Q)/(s,S) inventory policies to storage #574

Merged
merged 8 commits into from
Feb 7, 2024

Conversation

nuclearkatie
Copy link
Contributor

@nuclearkatie nuclearkatie commented Jan 30, 2024

Relies on Cyclus PR cyclus#1646. Until that one is merged, this one cannot be merged. They should be merged together if possible

This PR implements the new TotalInvTracker from cyclus#1646 into Storage, which provides an agent-wide inventory limitation and is required as part of initializing the buy policy.

This fixes the janky way that Storage was previously calculating an agent-wide limitation! Now, the max_inv_size is applied to the whole facility through the use of TotalInvTracker. Closes #554, Storage no longer needs to change the capacity of Resource Buffers ever time step

This also adds two variables

  • reorder_point when total facility inventory is above this point, no new demands will be made. At or below this point, the agent will request material
  • reorder_quantity when applicable, agent will request exactly this amount. It will make an exclusive demand for exactly this value

When reorder_point is used alone, it results in a (s,S) or min/max inventory policy. When the buffer inventory is below reorder_point, buypol tries to buy up to a full facility (max_inv_size, which is facility-wide). When used with reorder_quantity, this is a (R,Q) buy pol where the facility makes a single exclusive request of size reorder_quantity once below reorder_point. In both cases, when the inventory is above reorder_point, no requests are made

Closes #577, closes #578

@nuclearkatie nuclearkatie changed the title Applies TotalInvTracker and (R,Q) inventory policy to storage Applies TotalInvTracker and (R,Q)/(s,S) inventory policies to storage Jan 31, 2024
@gonuke gonuke added this to the Active-Dormant Buy Policy milestone Feb 5, 2024
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty clean - looking forward to reviewing it with a working kernel.

src/storage.cc Show resolved Hide resolved
src/storage.cc Outdated Show resolved Hide resolved
src/storage_tests.cc Outdated Show resolved Hide resolved
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nuclearkatie - nice to see this implemented

@gonuke gonuke merged commit 622db4c into cyclus:main Feb 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants