print best actions in current state
This commit is contained in:
parent
c77215ed14
commit
6ae9244fa6
1 changed files with 11 additions and 1 deletions
12
main.cpp
12
main.cpp
|
@ -23,6 +23,16 @@ namespace Hanabi {
|
||||||
std::cout << "Probability with optimal play: " << res << std::endl;
|
std::cout << "Probability with optimal play: " << res << std::endl;
|
||||||
std::cout << "Enumerated " << game->enumerated_states() << " states" << std::endl;
|
std::cout << "Enumerated " << game->enumerated_states() << " states" << std::endl;
|
||||||
std::cout << "Visited " << game->position_tablebase().size() << " unique game states. " << std::endl;
|
std::cout << "Visited " << game->position_tablebase().size() << " unique game states. " << std::endl;
|
||||||
|
for (const auto &[action, probability] : game->get_reasonable_actions()) {
|
||||||
|
std::cout << action;
|
||||||
|
if(probability.has_value()) {
|
||||||
|
std::cout << " " << probability.value();
|
||||||
|
} else {
|
||||||
|
std::cout << " unknown";
|
||||||
|
}
|
||||||
|
std::cout << ", ";
|
||||||
|
}
|
||||||
|
std::cout << std::endl;
|
||||||
unsigned long biggest_key = 0;
|
unsigned long biggest_key = 0;
|
||||||
for(const auto& [key, prob] : game->position_tablebase()) {
|
for(const auto& [key, prob] : game->position_tablebase()) {
|
||||||
biggest_key = std::max(biggest_key, key);
|
biggest_key = std::max(biggest_key, key);
|
||||||
|
@ -107,7 +117,7 @@ void check_games(unsigned num_players, unsigned max_draw_pile_size, unsigned fir
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
test();
|
// test();
|
||||||
#endif
|
#endif
|
||||||
if(argc == 3) {
|
if(argc == 3) {
|
||||||
std::string game(argv[1]);
|
std::string game(argv[1]);
|
||||||
|
|
Loading…
Reference in a new issue