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

CEP 30 - Improvements to Cyclus Supply-Demand Framework #396

Open
wants to merge 1 commit into
base: source
Choose a base branch
from

Conversation

dean-krueger
Copy link

After gathering informal community feedback, this is a more formal first draft of an official CEP on the website. I made sure it all displays correctly on a local spinup of the website I tested following the instructions in the README.

@dean-krueger dean-krueger requested a review from gonuke December 30, 2024 04:00
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 few editorial changes as well as some clarifications.

*********************************************************

:CEP: 30
:Title: Improvements to Cyclus Supply-Demand Framework
Copy link
Member

Choose a reason for hiding this comment

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

This title is vague and all-encompassing.

This CEP should be targeted at sharing financial parameters between the R-I-F hierarchy, and the title should be clear at this more narrow scope.

Comment on lines +20 to +26
Framework section of CEP 18. This CEP references moving the Supply-Demand from being
requester based to being supplier based, with more considerations for economics. As a part
of moving the DRE in that direction, it is necessary to add economic-based elements to
the definitions of the Region, Institution, and Facility in such a way as to allow them
to interact with each other economically. The proposal for doing so is to add sub-classes
to each which will act as a method of communicating economic information between layers
of the simulation.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Framework section of CEP 18. This CEP references moving the Supply-Demand from being
requester based to being supplier based, with more considerations for economics. As a part
of moving the DRE in that direction, it is necessary to add economic-based elements to
the definitions of the Region, Institution, and Facility in such a way as to allow them
to interact with each other economically. The proposal for doing so is to add sub-classes
to each which will act as a method of communicating economic information between layers
of the simulation.
Framework section of [CEP 18](https://fuelcycle.org/cep/cep18.html). In particular, that CEP
suggests that the introduction of economic concepts could allow the supplier to have more
influence over the preferences of particular trading paths. As a part
of moving the DRE in that direction, it is necessary to add economic parameters to
the definitions of the Region, Institution, and Facility in such a way as to allow them
to interact with each other to combine these parameters in meaningful ways. The proposal
for doing so is to add sub-classes
to each which will act as a method of communicating economic information between layers
of the simulation.

Comment on lines +37 to +38
Facility classes which will allow the communication of economic data between each layer
of the CYCLUS simulation. The main feature of the subclass will be a hash table
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Facility classes which will allow the communication of economic data between each layer
of the CYCLUS simulation. The main feature of the subclass will be a hash table
Facility classes which will allow the communication of economic/financial data between each layer
of the CYCLUS Region-Institution-Facility hierarchy. The main feature of the subclass will be a hash table

The major motivation for this new feature is that currently when a Facility tries to access
information about its Institution, it can only reliably use the public API of the Institution
base class. That is, it is dangerous to try to access something that is only in the public
API of a derived Institution archetype because it may not always be there. Because of the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
API of a derived Institution archetype because it may not always be there. Because of the
API of a derived Institution archetype because it may not always be there.
This eliminates the use of the optional Toolkit to introduce economic/financial parameters
into agents that are required to interact for those parameters since C++ doesn't provide
a way to interrogate the API of an agent.
Because of the

information about its Institution, it can only reliably use the public API of the Institution
base class. That is, it is dangerous to try to access something that is only in the public
API of a derived Institution archetype because it may not always be there. Because of the
interdependence of imagined economic functionality on the Facility-Institution-Region
Copy link
Member

Choose a reason for hiding this comment

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

by convention, I think (?) we prefer the R-I-F order for describing this

Suggested change
interdependence of imagined economic functionality on the Facility-Institution-Region
interdependence of imagined economic functionality on the Region-Institution-Facility

Rationale:
===========================

It was decided to make the overall feature a subclass is to keep it in line with the class-subclass
Copy link
Member

Choose a reason for hiding this comment

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

(Remove unnecessary passive voice)

Suggested change
It was decided to make the overall feature a subclass is to keep it in line with the class-subclass
Implementing the overall feature as a subclass keeps it in line with the class-subclass

===========================

It was decided to make the overall feature a subclass is to keep it in line with the class-subclass
structure of other CYCLUS functionality, such as the Facility Institution Region - Agent structure.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
structure of other CYCLUS functionality, such as the Facility Institution Region - Agent structure.
structure of other CYCLUS functionality, such as the `TimeAgent` or `Trader` features that are inherited this way.


During the public vetting stage of CEP 30’s lifecycle two alternative ideas for implementing this
behavior were proposed. The first was to use the code injection functionality of cycpp files to
add economic information to archetypes themselves at the beginning of simulations. This was tested,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
add economic information to archetypes themselves at the beginning of simulations. This was tested,
add economic information as an optional Toolkit feature to archetypes themselves at the beginning of simulations. This was tested,

add economic information to archetypes themselves at the beginning of simulations. This was tested,
but it was discovered that there were problems accessing the information of parent agents, and it
was determined that this approach would be some combination of too cumbersome and less certain to
work. The second idea was to implement some sort of registry, similar to how Microsoft Windows
Copy link
Member

Choose a reason for hiding this comment

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

Not sure we need to focus on MS Windows as the model here.

This is also probably in addition to the Toolkit/code injection, but the code injection would include a facility for archetypes to register their ability to respond to financial requests in some globally accessible place.

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.

2 participants