public void sampleCustomer(int type, int table) {
        double d = discount.doubleVal();
        double c = concentration.doubleVal();
        int[] tsa = tableMap.get(type);
        int tt = 0;
        int tc = -1;

        int zeroInd = -1;
        for (int i = 0; i < tsa.length; i++) {
            tc += tsa[i];
            if (tsa[i] > 0) {
                tt++;
            } else {
                zeroInd = i;
            }
        }

        tsa[table] -= 1;
        if (tsa[table] == 0) {
            parent.unseat(type);
            tables -= 1;
            tt--;
            zeroInd = table;
        }

        double r = RNG.nextDouble();
        double cuSum = 0.0;
        double pp = parent.predictiveProbability(type);
        double totalWeight = tc - tt * d + (tables * d + c) * pp;

        for (int i = 0; i < tsa.length; i++) {
            if (tsa[i] > 0) {
                cuSum += (tsa[i] - d) / totalWeight;
            }
            if (cuSum > r) {
                tsa[i] += 1;
                break;
            }
        }

        if (cuSum <= r) {
            tables += 1;
            if (zeroInd > -1) {
                tsa[zeroInd] += 1;
            } else {
                int[] ntsa = new int[tsa.length + 1];
                System.arraycopy(tsa, 0, ntsa, 0, tsa.length);
                ntsa[tsa.length] = 1;
                tableMap.put(type, ntsa);
            }
            parent.seat(type);
        }
    }