File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
src/main/java/ldbc/snb/datagen/generator/distribution Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 11
11
/**
12
12
* Created by aprat on 5/03/15.
13
13
*/
14
- public class ZetaDistribution extends BucketedDistribution {
14
+ public class ZetaDistribution implements DegreeDistribution {
15
15
16
- private ArrayList <Bucket > buckets_ ;
17
16
private ZipfDistribution zipf_ ;
18
17
private double ALPHA_ = 1.7 ;
19
18
20
- @ Override
21
- public ArrayList <Bucket > getBuckets () {
22
- return buckets_ ;
23
- }
24
-
25
- @ Override
26
19
public void initialize (Configuration conf ) {
27
20
zipf_ = new ZipfDistribution (DatagenParams .numPersons , ALPHA_ );
21
+ }
28
22
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
+ }
33
26
34
- buckets_ = Bucket .bucketizeHistogram (histogram ,100 );
27
+ public long nextDegree (){
28
+ return zipf_ .sample ();
35
29
}
36
30
}
You can’t perform that action at this time.
0 commit comments