June 2018
Intermediate to advanced
436 pages
10h 33m
English
Now the agent's action plan is known. The next task is providing some guidance to the agent moving from the current position towards the goal. For example, not all the action is accurate, that is, a bad move:
// Show guidance move to agent float[][] doMove(float[][] CurrMap, int action) { float nextMap[][] = new float[size][size]; for(int i = 0; i < size * size; i++) nextMap[i / size][i % size] = CurrMap[i / size][i % size]; int agent = calcAgentPos(CurrMap); nextMap[agent / size][agent % size] = 0; if(action == 0) { if(agent - size >= 0) nextMap[(agent - size) / size][agent % size] = 1; else { System.out.println("Bad Move"); System.exit(0); } } else if(action == 1) { if(agent + size < size * size) nextMap[(agent ...Read now
Unlock full access