-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.h
125 lines (116 loc) · 3.7 KB
/
options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
doko is a C++ doppelkopf program with an integrated UCT player.
Copyright (c) 2011-2016 Silvan Sievers
For questions, please write to: [email protected]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPTIONS_H
#define OPTIONS_H
#include "cards.h"
#include <vector>
enum player_t {
UCT,
HUMAN,
RANDOM
};
class Options {
private:
int number_of_games;
bool no_solo;
bool compulsory_solo;
std::vector<player_t> players_types;
bool random_cards;
int random_seed;
bool verbose;
bool uct_verbose;
bool debug;
bool uct_debug;
std::vector<std::vector<int> > players_options;
bool create_graph;
int announcing_version;
public:
Options(int number_of_games, bool no_solo, bool compulsory_solo, const std::vector<player_t> &players_types,
bool random, int random_seed, bool verbose, bool uct_verbose, bool debug, bool uct_debug,
const std::vector<std::vector<int> > &players_options, bool create_graph, int announcing_version);
int get_number_of_games() const {
return number_of_games;
}
bool solo_disabled() const {
return no_solo;
}
bool use_compulsory_solo() const {
return compulsory_solo;
}
const std::vector<player_t> &get_players_types() const {
return players_types;
}
bool use_random_cards() const {
return random_cards;
}
int get_random_seed() const {
return random_seed;
}
bool use_verbose() const {
return verbose;
}
bool use_uct_verbose() const {
return uct_verbose;
}
bool use_debug() const {
return debug;
}
bool use_uct_debug() const {
return uct_debug;
}
int get_uct_version(int player) const {
return players_options[player][0];
}
int get_score_points_constant(int player) const {
return players_options[player][1];
}
bool use_team_points(int player) const {
return (players_options[player][2] == 1);
}
int get_playing_points_constant(int player) const {
return players_options[player][3];
}
int get_exploration_constant(int player) const {
return players_options[player][4];
}
int get_number_of_rollouts(int player) const {
return players_options[player][5];
}
int get_number_of_simulations(int player) const {
return players_options[player][6];
}
int get_announcement_option(int player) const {
return players_options[player][7];
}
bool use_wrong_uct_formula(int player) const {
return players_options[player][8];
}
int get_simulation_option(int player) const {
return players_options[player][9];
}
int get_action_selection_version(int player) const {
return players_options[player][10];
}
bool use_create_graph() const {
return create_graph;
}
int get_announcing_version() const {
return announcing_version;
}
bool specify_cards_manually(Cards cards[4]) const; // return true iff user specifies cards manually, false iff he decides to use a random distribution
void dump() const;
};
#endif