Getting ready...

Before delving into the main algorithm, you should have certain data structures implemented. We need to define a structure for the game state, another for the game actions, and a class for defining an instance of the problem. They can coexist in the same file.

The following is an example of the data structure for defining a game state:

public struct GameState 
{ 
    // TODO 
    // your state definition here 
} 

The following is an example of the data structure for defining a game action:

public struct GameAction 
{ 
    // TODO 
    // your action definition here 
}

Finally, we will build the data type for defining a problem instance:

  1. Create the file and class:
public class ReinforcementProblem 
{ 
} 
  1. Define a virtual function for retrieving ...

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.