public class CopyDistribution extends Object implements Distribution
Hence, this class can be used as the in-degree distribution to ensure that the in-degree of a vertex is equal to the out-degree.
Constructor and Description |
---|
CopyDistribution() |
Modifier and Type | Method and Description |
---|---|
Distribution |
initialize(int invocations,
int expectedTotal)
Initializes the distribution such that expectedTotal is equal to the expected sum of generated values
after the given number of invocatiosn.
|
int |
nextConditionalValue(Random random,
int otherValue)
Returns the next value conditional on another given value.
|
int |
nextValue(Random random)
Returns the next value.
|
public Distribution initialize(int invocations, int expectedTotal)
Distribution
Since most distributions have an element of randomness, these values are the expected values.
initialize
in interface Distribution
public int nextValue(Random random)
Distribution
DO NOT use your own internal random generator as this makes the generated values non-reproducible and leads to faulty behavior.
nextValue
in interface Distribution
random
- random generator to use for randomnesspublic int nextConditionalValue(Random random, int otherValue)
Distribution
This can be used, for instance, to define conditional degree distributions where the in-degree is conditional on the out-degree.
If this value is randomly generated, the randomness must be drawn from the provided random generator. DO NOT use your own internal random generator as this makes the generated values non-reproducible and leads to faulty behavior.
nextConditionalValue
in interface Distribution
random
- random generator to use for randomnessotherValue
- The prior valueCopyright © 2013–2018 Apache Software Foundation. All rights reserved.