Skip to content

Commit 96f57a2

Browse files
committed
Added non bucketized zeta distribution
1 parent 9b5c78c commit 96f57a2

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/main/java/ldbc/snb/datagen/generator/distribution/ZetaDistribution.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,20 @@
1111
/**
1212
* Created by aprat on 5/03/15.
1313
*/
14-
public class ZetaDistribution extends BucketedDistribution {
14+
public class ZetaDistribution implements DegreeDistribution {
1515

16-
private ArrayList<Bucket> buckets_;
1716
private ZipfDistribution zipf_;
1817
private double ALPHA_ = 1.7;
1918

20-
@Override
21-
public ArrayList<Bucket> getBuckets() {
22-
return buckets_;
23-
}
24-
25-
@Override
2619
public void initialize(Configuration conf) {
2720
zipf_ = new ZipfDistribution(DatagenParams.numPersons, ALPHA_);
21+
}
2822

29-
ArrayList<Double> histogram = new ArrayList<Double>();
30-
for( int i = 1; i <= DatagenParams.numPersons; ++i ) {
31-
histogram.add(DatagenParams.numPersons * zipf_.probability(i));
32-
}
23+
public void reset (long seed) {
24+
zipf_.reseedRandomGenerator(seed);
25+
}
3326

34-
buckets_ = Bucket.bucketizeHistogram(histogram,100);
27+
public long nextDegree(){
28+
return zipf_.sample();
3529
}
3630
}

0 commit comments

Comments
 (0)