perceptionForAgent(data, agentID) {
        let map = data.world;
        let agentState = data.states[agentID];
        let x = agentState.x;
        let y = agentState.y;
        let result = [];
        //LEFT
        result.push(x > 0 ? map[y][x - 1] : 1);
        //UP
        result.push(y > 0 ? map[y - 1][x] : 1);
        //RIGTH
        result.push(x < map[0].length - 1 ? map[y][x + 1] : 1);
        //DOWN
        result.push(y < map.length - 1 ? map[y + 1][x] : 1);
    
        result = result.map(value => value > 0 ? 1 : 0);
        //SMELL
    
        result.push(Math.abs(map[y][x]));
        return result;
    }
/**
     * Gives the world representation for the agent at the current stage
     * @param {*} agentID 
     * @returns and object with the information to be sent to the agent
     */
Gives the world representation for the agent at the current stage
@param {*} agentID
@returns and object with the information to be sent to the agent
Gives the world representation for the agent at the current stage @param { * } agentID @returns and object with the information to be sent to the agent
perceptionForAgent(data, agentID) {
        let map = data.world;
        let agentState = data.states[agentID];
        let x = agentState.x;
        let y = agentState.y;
        let result = [];
        result.push(x > 0 ? map[y][x - 1] : 1);
        result.push(y > 0 ? map[y - 1][x] : 1);
        result.push(x < map[0].length - 1 ? map[y][x + 1] : 1);
        result.push(y < map.length - 1 ? map[y + 1][x] : 1);
        result = result.map(value => value > 0 ? 1 : 0);
        result.push(Math.abs(map[y][x]));
        return result;
    }
perceptionForAgent ( data , agentID ) { let map = data . world ; let agentState = data . states [ agentID ] ; let x = agentState . x ; let y = agentState . y ; let result = [ ] ; result . push ( x > 0 ? map [ y ] [ x - 1 ] : 1 ) ; result . push ( y > 0 ? map [ y - 1 ] [ x ] : 1 ) ; result . push ( x < map [ 0 ] . length - 1 ? map [ y ] [ x + 1 ] : 1 ) ; result . push ( y < map . length - 1 ? map [ y + 1 ] [ x ] : 1 ) ; result = result . map ( value => value > 0 ? 1 : 0 ) ; result . push ( Math . abs ( map [ y ] [ x ] ) ) ; return result ; }
Gives the world representation for the agent at the current stage
 @param {*} agentID
 @returns and object with the information to be sent to the agent
Gives the world representation for the agent at the current stage @param { * } agentID @returns and object with the information to be sent to the agent
//LEFT //UP //RIGTH //DOWN //SMELL