public void generate() {
        this.elements = new ArrayList<Element>();
        int size = this.cols * this.rows;

        for (int i = 0; i < size; i++) {
            Element element = null;

            if (i <= this.rows || i % this.rows == 0 || (i + 1) % this.rows == 0 || size - this.rows < i) {
                element = new Wall();
                element.setBreakable(false);
            } else if (Math.random() < this.probability_breakable_wall) {
                element = new Wall();
            } else if (Math.random() < this.probability_unbreakable_wall) {
                element = new Wall();
                element.setBreakable(false);
            }

            if (element != null) {
                element.setIndex(i);
            }

            this.elements.add(element);
        }
    }