forked from Fossana/cplusplus-cfr-poker-solver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActionNode.h
More file actions
37 lines (32 loc) · 1.11 KB
/
ActionNode.h
File metadata and controls
37 lines (32 loc) · 1.11 KB
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
#ifndef ACTION_NODE_H
#define ACTION_NODE_H
#include "Node.h"
#include "Action.h"
#include <vector>
#include <memory>
using std::unique_ptr;
using std::vector;
class ActionNode : public Node
{
private:
vector<float> strategySum;
vector<float> regretSum;
public:
int numHands = 0;
int numActions = 0;
vector<unique_ptr<Action>> actions;
vector<unique_ptr<Node>> children;
int player;
ActionNode(Node* parent, int player, int numHands);
void add_child(unique_ptr<Node> child, unique_ptr<Action> action);
void initialize_strategySum();
void initialize_regretSum();
vector<float> get_average_strategy();
int get_child_count();
Node* get_child(int index);
vector<float> get_current_strategy();
void update_regretSum_part_one(vector<float>& actionUtilities, int actionIndex);
void update_regretSum_part_two(vector<float>& utilities, int iterationCount);
void update_strategySum(vector<float>& strategy, vector<float>& reachProbs, int iterationCount);
};
#endif