Skip to content

Commit

Permalink
update some tests that rely on Randomizer #1141
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Jun 12, 2024
1 parent 547b42d commit a6e9195
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void testNormalDistribution() throws Exception {

// Fix seed: will hopefully ensure success of test unless something
// goes terribly wrong.
Thread.currentThread().setName("testNormalDistribution");
Randomizer.setSeed(127);

// Assemble model:
Expand Down Expand Up @@ -108,6 +109,7 @@ public void testLogNormalDistribution() throws Exception {

// Fix seed: will hopefully ensure success of test unless something
// goes terribly wrong.
Thread.currentThread().setName("testLogNormalDistribution");
Randomizer.setSeed(131);

// Assemble model:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ void doMCMCrun(RealParameter param, Operator bactrianOperator) throws IOExceptio
void doMCMCrun(RealParameter param, Operator bactrianOperator, Operator optionOperator) throws IOException, SAXException, ParserConfigurationException {
// Fix seed: will hopefully ensure success of test unless something
// goes terribly wrong.
Thread.currentThread().setName("doMCMCrun");
Randomizer.setSeed(127);

param.setBounds(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void testLogNormalDistribution() throws Exception {
void doMCMCrun(Function param, List<Operator> operators) throws IOException, SAXException, ParserConfigurationException {
// Fix seed: will hopefully ensure success of test unless something
// goes terribly wrong.
Thread.currentThread().setName("doMCMCrun");
Randomizer.setSeed(127);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class KernelDistiburionTest {

@Test
public void testBactrianKernelDistribution() {
Thread.currentThread().setName("testBactrianKernelDistribution");
Randomizer.setSeed(127);

// testMeanIsZeroSigmaIsOne(new KernelDistribution.Bactrian(mode.cauchy));
Expand Down Expand Up @@ -75,7 +76,8 @@ private void testMeanIsZeroSigmaIsOne(KernelDistribution.Bactrian distr, boolean
@Test
public void testMirrorfKernelDistribution() {
Log.warning("Testing mirror distribution");
Randomizer.setSeed(125);
Thread.currentThread().setName("testBactrianKernelDistribution");
Randomizer.setSeed(124);

KernelDistribution.Mirror distr = new KernelDistribution.Mirror(mode.bactrian_normal);

Expand Down Expand Up @@ -104,6 +106,7 @@ public void testMirrorfKernelDistribution() {
@Test
public void testMultiDimensionalMirrorfKernelDistribution() {
Log.warning("Testing mirror distribution");
Thread.currentThread().setName("testMultiDimensionalMirrorfKernelDistribution");
Randomizer.setSeed(123);

KernelDistribution.Mirror distr = new KernelDistribution.Mirror();
Expand Down Expand Up @@ -140,6 +143,7 @@ public void testMultiDimensionalMirrorfKernelDistribution() {
@Test
public void testMultiDimensionalMirrorfKernelDistributionScaler() {
Log.warning("Testing mirror distribution for scaling");
Thread.currentThread().setName("testMultiDimensionalMirrorfKernelDistributionScaler");
Randomizer.setSeed(123);

KernelDistribution.Mirror distr = new KernelDistribution.Mirror();
Expand Down

0 comments on commit a6e9195

Please sign in to comment.