|
Post by whocares on Mar 5, 2016 3:19:40 GMT -8
Hi guys. I need your help. I downloaded the java source code from github and I edited it as suggested in the ggp's coursera page: class.coursera.org/ggp-003/lecture (the last video) By using this video I just can able to act one specific move, like "move(0)". However, they say there is a simulation mode switch in this java source code, so we can try our possible moves first, then apply the best one by switching off the simulation mode. How can I find that attribute? More clearly, I think I need all the special functions of ggp source code to control my player. Can anyone help me about that a little? Thanks in advance.
|
|
|
Post by alandau on Mar 5, 2016 14:49:31 GMT -8
There isn't a "switch" here; you just need to use the methods on the StateMachine object.
The getState() method in the Gamer returns a MachineState that is the current state of the game that you are playing. You can call the getNextState(state, moves) method to get a different MachineState object. You can then pass that object into the StateMachine's methods to find out more information about it. For example, you can call theStateMachine.isTerminal(myNewState) to see if the game is over in that state.
Similarly, while you can call the getRole() method to get your own role in the game, you can call theStateMachine.getRoles() to get the complete list of participants in the game. This is important when looking ahead in the game, as you need to also consider your opponents' different move options as well as your own.
None of this changes what the current actual state of the game is, or what getState() returns. The rest of the codebase handles that for you. The only way the contents of that method will influence the course of the actual game is which Move you decide to return for the current state of the game.
Note that if the method does not return in time, the game server may declare a "timeout" for the player and pick a random move for it.
|
|