diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-31 19:26:33 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-31 19:26:33 +0200 |
commit | d19cde93fa3344f318fb0d4ffbf5bb0397a51a75 (patch) | |
tree | b5ee221d8a8e63c7d3b7868da1db19bf717a6ffd /src/ProbabDistrib.h | |
parent | Merge pull request #2400 from cuberite/OffloadBadChunks (diff) | |
parent | Unified the doxy-comment format. (diff) | |
download | cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.gz cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.bz2 cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.lz cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.xz cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.zst cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.zip |
Diffstat (limited to 'src/ProbabDistrib.h')
-rw-r--r-- | src/ProbabDistrib.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/ProbabDistrib.h b/src/ProbabDistrib.h index ddaadd9b7..29442bce8 100644 --- a/src/ProbabDistrib.h +++ b/src/ProbabDistrib.h @@ -48,25 +48,29 @@ public: cProbabDistrib(int a_MaxValue); - /// Sets the distribution curve using an array of [value, probability] points, linearly interpolated. a_Points must not be empty. + /** Sets the distribution curve using an array of [value, probability] points, linearly interpolated. a_Points must not be empty. */ void SetPoints(const cPoints & a_Points); - /// Sets the distribution curve using a definition string; returns true on successful parse + /** Sets the distribution curve using a definition string; returns true on successful parse */ bool SetDefString(const AString & a_DefString); - /// Gets a random value from a_Rand, shapes it into the distribution curve and returns the value. + /** Gets a random value from a_Rand, shapes it into the distribution curve and returns the value. */ int Random(MTRand & a_Rand) const; - /// Maps value in range [0, m_Sum] into the range [0, m_MaxValue] using the stored probability + /** Maps value in range [0, m_Sum] into the range [0, m_MaxValue] using the stored probability */ int MapValue(int a_OrigValue) const; int GetSum(void) const { return m_Sum; } protected: - int m_MaxValue; - cPoints m_Cumulative; ///< Cumulative probability of the values, sorted, for fast bsearch lookup - int m_Sum; ///< Sum of all the probabilities across all values in the domain; -1 if not set + int m_MaxValue; + + /** Cumulative probability of the values, sorted, for fast bsearch lookup */ + cPoints m_Cumulative; + + /** Sum of all the probabilities across all values in the domain; -1 if not set */ + int m_Sum; } ; |