diff options
author | John Fultz <jfultz@wolfram.com> | 2019-03-11 09:29:35 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2019-07-21 02:02:55 -0700 |
commit | be8c5f0f7fd2a2607ce8bf5ae60830a4d45f8e74 (patch) | |
tree | c47148ba6b6ec5bdba5281a7a64e6b1ee7fead72 /sim.h | |
parent | 6b32cf1706b17539597766bfb8ab454ea1e2be00 (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.h | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -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 |