-
Notifications
You must be signed in to change notification settings - Fork 3
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
Build example games #22
base: dev
Are you sure you want to change the base?
Conversation
src/game/mock/example.rs
Outdated
|
||
/* TREE GAME UTILITY IMPLEMENTATIONS */ | ||
|
||
impl SimpleSum<2> for TreeExampleGame<'_> { |
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.
Since all of the games here are simple utility, let's add an implementation like this one to all of the games in simple_utility
.
This will allow us to call these games' code from solvers expecting a SimpleSum<2>
game.
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.
Also, this might look like doing basically the exact same thing for all of the simple_sum
games, so I recommend factoring out the match
statement to minimize repeated code (as opposed to copying and pasting the impl
block and changing the name 6 times).
src/game/mock/example.rs
Outdated
|
||
/* DEFINITIONS */ | ||
|
||
/// TODO |
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.
Add docstrings to written games with useful information about what they can be used to test (in other words, maybe a list of useful characteristics that the example game has).
src/game/mock/example.rs
Outdated
store.append(&mut nodes); | ||
let store = &store[length..]; | ||
|
||
let game = builder::SessionBuilder::new(&TREE_GAME_NAME) |
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.
Great job making these nice and big, but let's try to not repeat the internal structures of the games among these standard tests. I haven't checked the other ones (as they do not render properly due to the naming issue), but at least this one seems to have nearly identical structure to the simple-utility general-sum cyclic example (line 295).
This is in order to get as much mileage out of these tests as we can. I recommend installing graphviz
with brew install graphviz
so that cargo test
produces renders that you can compare to check they're "different enough."
found this pr again lol |
i do not like how old me structured these commits; please see #37 before considering merge |
nevermind, rebasing remote branch is hard. either way i want to refactor before merging |
Nothing serious, I just thought this wasn't a "feature" per se. But sometimes, when I wake up on the other side of the bed, I do think it is a feature. I don't know, thinking about this philosophically ensnares me. Feel free to keep or remove it!
Approved changes in refactor PR -- thanks! Feel free to request another review on this PR when you think it's GTG. |
sg will do, thank u |
b64ab9c
to
d68753e
Compare
todos to self |
978cf05
to
79821d7
Compare
diff: + src/game/mock/example/ ! + general_utility/ /\_/\ ( + general_sum/ + Tree - Ayclic - Cyclic ( ^.^ ) _) + zero_sum/ - Tree - Ayclic - Cyclic \ / ( + simple_utility/ ( | | ) + general_sum/ + Tree + Ayclic + Cyclic (__d b__) + zero_sum/ + Tree + Ayclic + Cyclic
79821d7
to
946a45a
Compare
No description provided.