/** Initialize all the data structures relevant to the domain */ private void _initializeDataStructures() { this.possibleOperators = new Operator[this.numCakes]; // Initialize the operators (according to the updated position of the pancake) for (int i = 0; i < this.numCakes; ++i) { this.possibleOperators[i] = new PancakeOperator(i + 1); } // Set the maximum index (if it is not already defined) if (Pancakes.MAX_PANCAKE_FOR_PDB == -1) { this.maxPancakeForPDB = this.numCakes - 1; } else { this.maxPancakeForPDB = Pancakes.MAX_PANCAKE_FOR_PDB; } // calculate the bits and bitmask to store single pancake this.bitsForSinglePancake = Utils.bits(this.numCakes); this.maskForSinglePancake = Utils.mask(this.bitsForSinglePancake); // System.out.println("mask: " + this.maskForSinglePancake); this.packedCakesInSingleLong = Math.min(this.numCakes, (int) Math.floor(64.0d / this.bitsForSinglePancake)); // System.out.println("packedCakesInSingleLong: " + this.packedCakesInSingleLong); this.packedLongsCount = (int) Math.ceil(this.numCakes * this.bitsForSinglePancake / 64.0d); // System.out.println("packedLongsCount: " + this.packedLongsCount); // Current debugs .. // assert(this.bitsForSinglePancake == 5); // assert this.packedLongsCount == 2; }