Skip to content
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

Refactoring randoms #34

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Athear
Copy link

@Athear Athear commented Mar 13, 2013

I refactored all the instances of java.util.Random into utility.RandomGenerator.
For classes that only used the generator once or twice, I replaced those uses with RandomGenerator.[method used] and removed the variable assigned to the generator entirely. If there were multiple uses, or more than one kind of method called, I assigned their existing random-variable to RandomGenerator.generator.

A few problem subclasses had randoms hanging around unused. Those have been removed - the runners don't break and the tests still run, so I think this was okay.

malon153 added 4 commits March 13, 2013 15:05
GaussianConvolution)
Refactored all operators to use the project's random instead of an
external one. All tests still pass. Hoping they reflect use of random
sufficiently.
Refactored super classes to use our utility.RandomGenerator.
RandomGenerator has the advantage of not needing to be assigned to a
new variable if there aren't many places where it will be used.
Perhaps you knew that.
All tests pass.
@Athear
Copy link
Author

Athear commented Apr 3, 2013

DO NOT MERGE THIS.
I don't know how to withdraw a pull request. RandomGenerator.nextInt() returns 0 every time. I don't know what caused this, but until it's fixed, RandomGenerator is useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant