summaryrefslogtreecommitdiff
path: root/sim.h
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2019-03-11 09:29:35 -0500
committerJohn Fultz <jfultz@wolfram.com>2019-07-21 02:02:55 -0700
commitbe8c5f0f7fd2a2607ce8bf5ae60830a4d45f8e74 (patch)
treec47148ba6b6ec5bdba5281a7a64e6b1ee7fead72 /sim.h
parent6b32cf1706b17539597766bfb8ab454ea1e2be00 (diff)
Rework the simulation messaging.
Break out things that are effectively constant into a separate struct so we don't have to keep initializing them. Also, ensure that all of the things I forgot are abstracted so I can break out the per-move simulation into a different function.
Diffstat (limited to 'sim.h')
-rw-r--r--sim.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/sim.h b/sim.h
index ee03b4a..0b3a7fb 100644
--- a/sim.h
+++ b/sim.h
@@ -172,10 +172,11 @@ inline void SimmedMove::setIncludeInSimulation(bool includeInSimulation)
typedef vector<SimmedMove> SimmedMoveList;
-struct SimmedMoveMessage
+class SimmedMoveMessage
{
+public:
long id;
- Game game;
+ Move move;
LevelList levels;
vector<double> score;
vector<double> bingos;
@@ -185,10 +186,21 @@ struct SimmedMoveMessage
bool bogowin;
std::ostringstream logStream;
- bool isLogging;
UVString xmlIndent;
};
+class SimmedMoveConstants
+{
+public:
+ Game game;
+ int startPlayerId;
+ int playerCount;
+ int decimalTurns;
+ int levelCount;
+ bool ignoreOppos;
+ bool isLogging;
+};
+
class Simulator
{
public:
@@ -266,7 +278,7 @@ public:
// Incoporate the results of a single simulation into the
// cumulative results
- void incorporateMessage(const struct SimmedMoveMessage &message);
+ void incorporateMessage(const SimmedMoveMessage &message);
// Set oppo's rack to some partially-known tiles.
// Set this to an empty rack if no tiles are known, so