-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repaired Monte Carlo & Changed to Cells
Fixed bugs in the Monte Carlo player algorithm allowing for optimized use within both AI simulations and human games. Converted the vector systems from using indexing to using a Cell struct. This was done for both simplicity and optimization , with hopes that overall, the use of references to Cell items will be better than the process of calculating coordinate indices.
- Loading branch information
1 parent
912a7fa
commit de3f061
Showing
18 changed files
with
422 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
/* | ||
* Cell.h | ||
* | ||
* Created on: 26 Mar. 2019 | ||
* Author: dongmo | ||
*/ | ||
|
||
#ifndef CELL_H_ | ||
#define CELL_H_ | ||
|
||
struct Cell | ||
{ | ||
int x; | ||
int y; | ||
double heuristic; | ||
int x, y; //coordinates for the cell | ||
|
||
Cell(int _x, int _y) : x(_x), y(_y) | ||
{} | ||
|
||
}; | ||
|
||
struct Move | ||
{ | ||
int x, y; //coordinates for the move | ||
double v; //Cell value | ||
|
||
Cell(int xx, int yy, double hh) : x(xx), y(yy), heuristic(hh) | ||
Move(int _x, int _y, double _v) : x(_x), y(_y), v(_v) | ||
{} | ||
|
||
bool operator<(const Cell &c) const | ||
bool operator<(const Move &m) const | ||
{ | ||
return heuristic < c.heuristic; | ||
} | ||
return v < m.v; | ||
}; | ||
}; | ||
|
||
#endif /* CELL_H_ */ |
Oops, something went wrong.