| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final Array |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | generateNormalized()
Generate the cumulative distribution in [0,1] where each interval will get a frequency between [0,1] |
| public void | generateUniform()
Generate the cumulative distribution in [0,1] where each value will have the same frequency and interval size |
| public float | |
| public T | |
| public void | |
| public void | |
| public int | |
| public T | Returns: the value whose interval contains the probabilityFinds the value whose interval contains the given probability Binary search algorithm is used to find the value. |
| public T |
| values | back to summary |
|---|---|
| private final Array<CumulativeDistribution. | |
| CumulativeDistribution | back to summary |
|---|---|
| public CumulativeDistribution() | |
| add | back to summary |
|---|---|
| public void add(T value, float intervalSize) Adds a value with a given interval size to the distribution | |
| add | back to summary |
|---|---|
| public void add(T value) Adds a value with interval size equal to zero to the distribution | |
| clear | back to summary |
|---|---|
| public void clear() Removes all the values from the distribution | |
| generate | back to summary |
|---|---|
| public void generate() Generate the cumulative distribution | |
| generateNormalized | back to summary |
|---|---|
| public void generateNormalized() Generate the cumulative distribution in [0,1] where each interval will get a frequency between [0,1] | |
| generateUniform | back to summary |
|---|---|
| public void generateUniform() Generate the cumulative distribution in [0,1] where each value will have the same frequency and interval size | |
| getInterval | back to summary |
|---|---|
public float getInterval(int index)
| |
| getValue | back to summary |
|---|---|
public T getValue(int index)
| |
| setInterval | back to summary |
|---|---|
| public void setInterval(T obj, float intervalSize) Set the interval size on the passed in object. The object must be present in the distribution. | |
| setInterval | back to summary |
|---|---|
| public void setInterval(int index, float intervalSize) Sets the interval size for the value at the given index | |
| size | back to summary |
|---|---|
public int size()
| |
| value | back to summary |
|---|---|
| public T value(float probability) Finds the value whose interval contains the given probability Binary search algorithm is used to find the value.
| |
| value | back to summary |
|---|---|
public T value()
| |
| Modifier and Type | Field and Description |
|---|---|
| public float | |
| public float | |
| public T |
| Access | Constructor and Description |
|---|---|
| public |
| frequency | back to summary |
|---|---|
| public float frequency | |
| interval | back to summary |
|---|---|
| public float interval | |
| value | back to summary |
|---|---|
| public T value | |
| CumulativeValue | back to summary |
|---|---|
| public CumulativeValue(T value, float frequency, float interval) | |