Interface Distribution
- 
- All Known Implementing Classes:
- CopyDistribution,- NormalDistribution,- PowerLawDistribution
 
 public interface DistributionInterface for a distribution over discrete values. Used, for instance, byDistributionGeneratorto define the in- and out-degree distributions and byCommunityGeneratorto define the community size distribution.- Author:
- Matthias Broecheler (me@matthiasb.com)
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Distributioninitialize(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.intnextConditionalValue(Random random, int otherValue)Returns the next value conditional on another given value.intnextValue(Random random)Returns the next value.
 
- 
- 
- 
Method Detail- 
initializeDistribution 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. Since most distributions have an element of randomness, these values are the expected values.- Returns:
- A new distribution configured to match the expected total for the number of invocations.
 
 - 
nextValueint nextValue(Random random) Returns the next value. 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.- Parameters:
- random- random generator to use for randomness
- Returns:
- next value
 
 - 
nextConditionalValueint nextConditionalValue(Random random, int otherValue) Returns the next value conditional on another given value. 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.- Parameters:
- random- random generator to use for randomness
- otherValue- The prior value
- Returns:
- next value
 
 
- 
 
-