-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreinforce.h
58 lines (48 loc) · 1.16 KB
/
reinforce.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
//=================================
// include guard
#ifndef __REINFORCE_H_INCLUDED__
#define __REINFORCE_H_INCLUDED__
//=================================
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
class Reinforce {
int counter;
double learningRate;
double exploreRate;
double rate;
int myTurn;
string fileStore;
int exploits;
int explores;
int nextUpdate;
bool print;
bool shouldExplore();
int get_explore();
int get_exploit();
void updateRates();
double getValue ( string moves , bool retVal );
void updateFile( string moves, double value, int count );
string getName( string moves );
Game* game;
public:
Reinforce( Game* curr_game );
Reinforce( Game* curr_game, string filename );
void ReinforceError( );
void write( );
void setPrint( bool var );
int move( );
void stats( );
void update( );
int turn( ) { return myTurn; };
void log( int wins, int ties, int losses, int messes );
void change_game ( Game* curr_game ) { game = curr_game; };
};
//=================================
// end guard
#endif
//=================================