-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linear Probability Generator #86
Conversation
* Create ShortElementInterface * Create LinearShortElement
* Update LinearShortElement - set limit on rate parameter, enforce limits in constructor and setters
Remaining Tasks:
|
A sequence of
This is a common requirement. There is a known method of mediating the interaction between the number of states of the two The Lowest Common Multiple is an important number that solves this problem. A potential for integer overflow is present when calculating the Lowest Common Multiple of numbers with large differences in prime number composition. The LCM has to be multiplied again to obtain the relevant number, and so to limit this inflation, the The limit of 200 can be increased, but there should be a strategy to validate that the inputs can work together without causing an overflow. |
Another piece of the strategy is to look for changes in work required on large inputs. The |
* Update LinearShortElement - add documentation, add Random member, add constructor with Random argument, implement generate method, store number of LinearStates as member variable
* Update LinearShortElement - redesign countLinearStates method (use a loop instead of recursion)
* Update LinearShortElement - remove Rate parameter * Update LinearShortElement Tests - remove Rate parameter
* Lists and Arrays - Operation Byte Support (#85) Lists: * Create ByteList.kt - include similar methods to those of other types * Update ByteArrayExt - update code style, add findTargetValueN method Tests: * Create ByteArrayExtFindTargetValueNTest - add test cases for findTargetValueN * Create ByteListFindGreaterThanTest * Create ByteListFindLessThanTest * Create ByteListFindOutOfRangeTest * Create ByteListLargeSumTest * Create ByteListRemoveByIndicesTest * Update ByteArrayExtTest - improve newArray method, make available for test package, add test cases for sum method * Linear Probability Generator (#86) Generators: * Create LinearShortElement - add constructor with Random argument, implement generate method, store number of LinearStates as member variable * Create ShortElementInterface Tests: * Create LinearShortElementAnalysis - measure distributions of outcomes, combine length test cases into parameterized test * Create LinearShortElementPerformance - measure performance of different outcomes * Create LinearShortElementStaticTest - add test cases for the countLinearStates method * Create LinearShortElementTest * Update RandomProvider - update code style Build Updates: * Increase Artifact 0.4.3 -> 0.4.4 * Increase Generators Coverage Limits - Instruction 95, Branch 92 * Remove Lists Module dependency from Generators * Remove Kotlin Standard Library from dependencies
Create a Generator with a linearly changing probability.
The outcomes are arranged in consecutive order from 1 to Length. Length must be greater than zero.
The first outcome 1, has the highest probability. Each outcome reduces in probability at a constant Rate. Rate must be greater than zero.