Preconditions.checkNotNull(topicDistribution);
Preconditions.checkArgument(numSamples > 0, "numSamples must be positive");
Preconditions.checkArgument(topicDistribution.size() == samplers.length,
"topicDistribution must have same cardinality as the sampling model");
int[] samples = new int[numSamples];
Sampler topicSampler = new Sampler(random, topicDistribution);
for (int i = 0; i < numSamples; i++) {
samples[i] = samplers[topicSampler.sample()].sample();
}
return samples;
}