-
Notifications
You must be signed in to change notification settings - Fork 3
Create agent_commodities table
#468
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ff1af54
First pass at agent_commodities table
tsmbland ccf5707
Remove unused imports
tsmbland 12b99c4
Add validation checks
tsmbland 8cd42a7
Add tests
tsmbland dd8e73a
Add another test
tsmbland 6ae65f4
Merge branch 'main' into agent_commodities
tsmbland 47fd31b
Apply suggestions from code review
tsmbland 80dd6be
Remove agent_id field from AgentCommodity
tsmbland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| agent_id,commodity_id,year,commodity_portion | ||
| A0_GEX,GASPRD,2020,1 | ||
| A0_GEX,GASPRD,2030,1 | ||
| A0_GPR,GASNAT,2020,1 | ||
| A0_GPR,GASNAT,2030,1 | ||
| A0_ELC,ELCTRI,2020,1 | ||
| A0_ELC,ELCTRI,2030,1 | ||
| A0_RES,RSHEAT,2020,1 | ||
| A0_RES,RSHEAT,2030,1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| id,description,commodity_id,commodity_portion,search_space,decision_rule,capex_limit,annual_cost_limit,decision_lexico_tolerance | ||
| A0_GEX,Gas extractors,GASPRD,1,,single,,, | ||
| A0_GPR,Gas processors,GASNAT,1,,single,,, | ||
| A0_ELC,Electricity generators,ELCTRI,1,,single,,, | ||
| A0_RES,Residential consumer,RSHEAT,1,,single,,, | ||
| id,description,decision_rule,capex_limit,annual_cost_limit,decision_lexico_tolerance | ||
| A0_GEX,Gas extractors,single,,, | ||
| A0_GPR,Gas processors,single,,, | ||
| A0_ELC,Electricity generators,single,,, | ||
| A0_RES,Residential consumer,single,,, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking about this, it seems kinda weird to me that we don't also include a region field for the agent commodities stuff (we didn't when it was just a single commodity either so this isn't really about your PR). But how can it make sense for an agent to be responsible for e.g. 50% of the electricity in every region it operates in? Surely it would be different proportions for e.g. the UK and France if the agent operated in both?
Or have I missed something?
This is fine as a simplification for now. But it might be a limitation when it comes to modelling the real world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point and I agree. To be honest I still don't really have an intuitive understanding what it means for an agent to operate in multiple regions. Is it just a shortcut way of saying that we want identical agents in multiple regions, but these are still separate agents for each region (e.g. household agents in UK and France may have approximately similar demand profiles, so we simplify things by using a shared parameter set)? Or is it really a multi-region agent which receives demand from multiple regions and trades commodities between regions (e.g. an oil company)?
I discussed this with Adam last time we spoke and I think there are still open questions here which we/he need to think about. We also discussed scenarios where agents might have no fixed demand share and instead compete against each other to maximize demand share, which is something else that can't really be captured with this table.
Anyway, stuff to think about and bring up when we make plans for the next engagement, but I'd say it's fine to leave it for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed 👍