O'Reilly logo

Java Deep Learning Projects by Md. Rezaul Karim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Providing guidance action

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required