public class CMAC { int tilings,//number of tilings over state space xTile, //number of gridworld states spanned by tile in x dimension yTile, //number of gridworld states spanned by tile in y dimension xWorld, //number of gridworld states in the x dimension yWorld; //number of gridworld states in the y dimension public CMAC(int tilings, int tileWidth, int tileHeight, int worldWidth, int worldHeight) { this.tilings = tilings; xTile = tileWidth; yTile = tileHeight; xWorld = worldWidth; yWorld = worldHeight; }//CMAC() //returns unique indices of tiles covering gridworld state x,y //x must be between 0 and xWorld-1, y must be between 0 and yWorld-1 public long[] getTiles(int x, int y) { long[] tiles = new long[tilings]; for(int i=0; i