public void updateCoverage(double x, double y) {
        int gridx = (int) (x*((double) ncell_x / (double) width));
        int gridy = (int) (y*((double) ncell_y / (double) height));
        
        gridx = ( gridx < ncell_x ) ? gridx : ncell_x - 1;
        gridy = ( gridy < ncell_y ) ? gridy : ncell_y - 1;
        
        boolean updateCoverage = false;
        if (!obstacleArea.contains(gridx+","+gridy) && !coverage[gridy][gridx]) {
            updateCoverage = true;
            ++coveredCount;
        }
        
        if (obstacleBehind.contains(gridx+","+gridy) && updateCoverage) {
            ++behindCount;
        }
        
        coverage[gridy][gridx] = true;
    }