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

Add support for predicting opponent orders #32

Merged
merged 8 commits into from
Dec 18, 2024
Merged

Conversation

aphedges
Copy link
Contributor

This PR adds an implementation for a new suggestion type that predicts the orders of opponents. I made some related improvements to the advisor, most of them being related to the suggestion code.

For the library and UI implementations, see ALLAN-DIP/diplomacy#34. For client support, see ALLAN-DIP/chiron-utils#20.

PyCharm noticed this for me.
I discovered that the function can return `None` in some cases, so the
return type should be `Optional`.
These defaults should be declared in exactly one place.
`diplomacy` has a `SuggestionType` enum, so we should use it in all
places instead of explicit integer values. This commit replaces usages
in both `int`s and `str`s.

I made multiple related changes in this commit:

- Factor out description of suggestion types so it is not duplicated
  throughout the codebase
- Remove the `--chiron_type` argument, which is unused
- Treat advice level as a bit field so we don't need to enumerate all
  values that include a particular suggestion type
As I was looking through the logs to help with other changes, I noticed
some ways to improve the log output:

- Log arguments that were not being logged
- Reword unclear and incorrect messages
- Fix typos
- Remove duplicate log message
Unlike other advisors, CICERO can change what advice it sends each turn.
The new checks in `BaselineBot` caught that we do not adjust the field's
value when we change what suggestions we send, which means that users
might not see the UI elements that we want them to.
These predictions were already being generated, but they were being
ignored. We now can enable sending them as advice.

We currently intend to use this suggestion type only in Llama advisor.
There is no plan to display it in the UI.
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.

1 participant