public class ZipfianGenerator extends Random
| Modifier and Type | Field and Description |
|---|---|
static double |
ZIPFIAN_CONSTANT |
| Constructor and Description |
|---|
ZipfianGenerator(long _items)
Create a zipfian generator for the specified number of items.
|
ZipfianGenerator(long _items,
double _zipfianconstant)
Create a zipfian generator for the specified number of items using the
specified zipfian constant.
|
ZipfianGenerator(long _min,
long _max)
Create a zipfian generator for items between min and max.
|
ZipfianGenerator(long min,
long max,
double _zipfianconstant)
Create a zipfian generator for items between min and max (inclusive) for
the specified zipfian constant.
|
ZipfianGenerator(long min,
long max,
double _zipfianconstant,
double _zetan)
Create a zipfian generator for items between min and max (inclusive) for
the specified zipfian constant, using the precomputed value of zeta.
|
| Modifier and Type | Method and Description |
|---|---|
int |
nextInt()
Return the next value, skewed by the Zipfian distribution.
|
int |
nextInt(int itemcount)
Generate the next item.
|
long |
nextLong()
Return the next value, skewed by the Zipfian distribution.
|
long |
nextLong(long itemcount)
Generate the next item as a long.
|
public static final double ZIPFIAN_CONSTANT
public ZipfianGenerator(long _items)
_items - The number of items in the distribution.public ZipfianGenerator(long _min,
long _max)
_min - The smallest integer to generate in the sequence._max - The largest integer to generate in the sequence.public ZipfianGenerator(long _items,
double _zipfianconstant)
_items - The number of items in the distribution._zipfianconstant - The zipfian constant to use.public ZipfianGenerator(long min,
long max,
double _zipfianconstant)
min - The smallest integer to generate in the sequence.max - The largest integer to generate in the sequence._zipfianconstant - The zipfian constant to use.public ZipfianGenerator(long min,
long max,
double _zipfianconstant,
double _zetan)
min - The smallest integer to generate in the sequence.max - The largest integer to generate in the sequence._zipfianconstant - The zipfian constant to use._zetan - The precomputed zeta constant.public int nextInt(int itemcount)
public long nextLong(long itemcount)
itemcount - The number of items in the distribution.public int nextInt()
public long nextLong()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.