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

Buy policy can cycle back and forth between actively buying and dormant based on time step #1596

Merged
merged 14 commits into from
Nov 28, 2023

Conversation

nuclearkatie
Copy link
Contributor

Two new buy policy parameters, active and dormant. Both are integers representing a number of time steps.

  • For active part of the cycle, buying behavior is unchanged
  • For dormant, agent will not request any new material from DRE

@gonuke
Copy link
Member

gonuke commented Oct 17, 2023

If you rebase this, @nuclearkatie, we can see if the new tests pass

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.

A couple of little changes. I also wonder if we can add a test or two to the existing unit testing?

src/toolkit/matl_buy_policy.h Show resolved Hide resolved
src/toolkit/matl_buy_policy.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.

This looks pretty good - a few final comments.

tests/toolkit/matl_buy_policy_tests.cc Outdated Show resolved Hide resolved
tests/toolkit/matl_buy_policy_tests.cc Outdated Show resolved Hide resolved
tests/toolkit/matl_buy_policy_tests.cc Show resolved Hide resolved
tests/toolkit/matl_buy_policy_tests.cc Show resolved Hide resolved
@nuclearkatie
Copy link
Contributor Author

In addition to adding a test for the active/dormant buying policy, I expanded the one main test (Reqs) to several tests (OneReq, MultipleReqs, Quantize, MultiReqQuantize).

I find it easier as a developer to have multiple smaller tests of one concept each than one larger test that is checking for multiple stacking concepts (sending a request, sending requests for multiple commodities, quantizing requests). At least, this makes it faster/easier to determine which part of the pre-existing code I broke.

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.

Looks good to me, thanks @nuclearkatie

@gonuke gonuke merged commit e2ae243 into cyclus:main Nov 28, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants