public void calculateTemp() {
        if (this.constantTemp) {
            return;
        }
        long result = 0;
        long tmp = 0;
        for (int i = 0; i < thermalConstants.length; i++) {
            for (int j = 0; j < neighbors.size(); j++) {
                tmp += (neighbors.get(j).getTemp() * (neighbors.get(j).getMetalPercentage(i)));
            }
            tmp = ((((long) (thermalConstants[i] * 100)) * tmp) / 100) / neighbors.size();
            result += tmp;
            tmp = 0;
        }
        sa.temps[sa.updating][indexI][indexJ] = result;
    }