-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.cpp
More file actions
120 lines (110 loc) · 2.39 KB
/
Copy pathconstants.cpp
File metadata and controls
120 lines (110 loc) · 2.39 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
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
#include "constants.h"
//MonteCarlo things
double LEARNING_RATE = 0.2;
int numCores = 1;
int MonteCarloSimulations = 100;
int MonteCarloSimulationsCutoff = 500;
double explorationFactor = 1.41;
double heuristicFactor = .5;
unordered_map<Direction, Direction> oppositeDirection =
{
{Direction::N, Direction::S},
{Direction::E, Direction::W},
{Direction::W, Direction::E},
{Direction::S, Direction::N},
{Direction::NW, Direction::SE},
{Direction::NE, Direction::SW},
{Direction::SW, Direction::NE},
{Direction::SE, Direction::NW}
};
Direction rotateClockWise(Direction dir) {
switch (dir) {
case NE:
return Direction::E;
case E:
return Direction::SE;
case SE:
return Direction::SW;
case SW:
return Direction::W;
case W :
return Direction::NW;
case NW:
return Direction::NE;
default:
std::cout << "cannot rotateClockWise nonHexagonalDirection" << std::endl;
throw 20;
}
}
Direction rotateCounterClockWise(Direction dir) {
switch (dir) {
case NE:
return Direction::NW;
case E:
return Direction::NE;
case SE:
return Direction::E;
case SW:
return Direction::SE;
case W :
return Direction::SW;
case NW:
return Direction::W;
default:
std::cout << "cannot rotateCounterClockWise nonHexagonalDirection" << std::endl;
throw 21;
}
}
unsigned modulo( int value, unsigned m) {
int mod = value % (int)m;
if (value < 0) {
mod += m;
}
return mod;
}
vector < unordered_map <PieceName, int>> HiveOriginal =
{
{
{PieceName::GRASSHOPPER, 3},
{PieceName::QUEEN, 1},
{PieceName::LADYBUG, 0},
{PieceName::PILLBUG, 0},
{PieceName::MOSQUITO, 0},
{PieceName::BEETLE, 2},
{PieceName::ANT, 3},
{PieceName::SPIDER, 2}
},
{
{PieceName::GRASSHOPPER, 3},
{PieceName::QUEEN, 1},
{PieceName::LADYBUG, 0},
{PieceName::PILLBUG, 0},
{PieceName::MOSQUITO, 0},
{PieceName::BEETLE, 2},
{PieceName::ANT, 3},
{PieceName::SPIDER, 2}
}
};
vector < unordered_map <PieceName, int>> HivePLM =
{
{
{PieceName::GRASSHOPPER, 3},
{PieceName::QUEEN, 1},
{PieceName::LADYBUG, 1},
{PieceName::PILLBUG, 1},
{PieceName::MOSQUITO, 1},
{PieceName::BEETLE, 2},
{PieceName::ANT, 3},
{PieceName::SPIDER, 2}
},
{
{PieceName::GRASSHOPPER, 3},
{PieceName::QUEEN, 1},
{PieceName::LADYBUG, 1},
{PieceName::PILLBUG, 1},
{PieceName::MOSQUITO, 1},
{PieceName::BEETLE, 2},
{PieceName::ANT, 3},
{PieceName::SPIDER, 2}
}
};