implemented WeightedRandomModel class