update(data, action, agentID) {
        let map = data.world;
        let agentState = data.states[agentID];
        if (action == "UP") {
            agentState.y -= 1;
        }
        if (action == "DOWN") {
            agentState.y += 1;
        }
        if (action == "LEFT") {
            agentState.x -= 1;
        }
        if (action == "RIGHT") {
            agentState.x += 1;
        }
        if (action == "TAKE") {
            map[agentState.y][agentState.x] = 0;
        }
        if (!data.interations) {
            data.interations = 1;
        } else {
            data.interations++;
        }
    }
/**
     * The transition model. Tells how to change the state (data) based on the given actions. You must override
     * @param {} data 
     * @param {*} action 
     * @param {*} agentID 
     */
The transition model. Tells how to change the state (data) based on the given actions.
The transition model . Tells how to change the state ( data ) based on the given actions .
update(data, action, agentID) {
        let map = data.world;
        let agentState = data.states[agentID];
        if (action == "UP") {
            agentState.y -= 1;
        }
        if (action == "DOWN") {
            agentState.y += 1;
        }
        if (action == "LEFT") {
            agentState.x -= 1;
        }
        if (action == "RIGHT") {
            agentState.x += 1;
        }
        if (action == "TAKE") {
            map[agentState.y][agentState.x] = 0;
        }
        if (!data.interations) {
            data.interations = 1;
        } else {
            data.interations++;
        }
    }
update ( data , action , agentID ) { let map = data . world ; let agentState = data . states [ agentID ] ; if ( action == "UP" ) { agentState . y -= 1 ; } if ( action == "DOWN" ) { agentState . y += 1 ; } if ( action == "LEFT" ) { agentState . x -= 1 ; } if ( action == "RIGHT" ) { agentState . x += 1 ; } if ( action == "TAKE" ) { map [ agentState . y ] [ agentState . x ] = 0 ; } if ( ! data . interations ) { data . interations = 1 ; } else { data . interations ++ ; } }
The transition model.
The transition model .