Repository navigation
ModelBasedAgent
Charlie Ringer edited this page Apr 28, 2017
·
2 revisions
A Model based approach where a supplied model is used to select moves. Note: because this method relies solely on the learnt Model it is unlikely to perform well on it's own compared to MCTS methods.
- Create a class which inherits from AI State.
- Train a model and construct it (see Model for more infomation).
- Construct this using one of the supplied constructors.
- When you are ready to calculate the next move pass the current state into run()
- The AI will run on a sperate thread so keep checking back to see if the
doneflag is true. (The AI runs on a separate thread to decouple it from your code.) - Once the AI is done and you have retrieved the next state from
nextcallreset()to reset the AI.
| Name | Description |
|---|---|
| ModelBasedAgent(Model _model) | Constructs an AI using the supplied model |
| Return Type | Name | Description |
|---|---|---|
| void | run(AIState initalState) | Starts the AI with a supplied starting state. |
| void | reset() | Used once the next move have been retrieved to reset the AI ready for the next iteration |
| Type | Name | Description |
|---|---|---|
| bool | done | True if the AI has finished thinking, false otherwise |
| bool | started | True if this AI iteration has started |
| AIState | next | The next move, represented in an AI state. Null if the AI is thinking |