public static int[][] generateMap(int width, int height, float roughness) {
    	boolean[][] bool_map;
    	int[][] int_map = new int[width][height];
        Perlin n = new Perlin(null, roughness, width, height);
        int cpt = 0;
        boolean finished = false;
        
        do {
            n.initialise();
            bool_map = n.toBooleans();
            cpt = 0;
            
             for(int i = 0; i < width; i++) {
             	for(int j = 0; j < height; j++) {
             		if(bool_map[i][j]) {
             			int_map[i][j] = 1;
             			cpt++;
             		}
             		else {
             			int_map[i][j] = 0;
             		}
             	}
             }
             if (cpt > (width*height/2)) {
            	 finished = true;
             }
        }while (!finished);
       
		return int_map;
    }