use of org.apache.commons.math3.random.Well1024a in project mixcr by milaboratory.
the class ClonalSequenceTest method testIsCompatible5.
@Test
public void testIsCompatible5() throws Exception {
RandomGenerator random = new Well1024a();
ClonalSequence c1 = create("AAAAAAAAAA", "AAAAAAAAAAAAAA");
ClonalSequence c2 = create("AAAAA", "AAAAAAA");
testCompatiblePair(c1, c2, random);
testCompatiblePair(c2, c1, random);
// c2 = create("AAAAA", "AAAAAAAAAAAAAAAAAAAAAAAAAA");
// testCompatiblePair(c1, c2, random);
// testCompatiblePair(c2, c1, random);
// c2 = create("AAAAAAAAAAAAAAAAAAAAAAAAAA", "AAAAA");
// testCompatiblePair(c1, c2, random);
// testCompatiblePair(c2, c1, random);
}
use of org.apache.commons.math3.random.Well1024a in project mixcr by milaboratory.
the class ClonalSequenceTest method testIsCompatible2.
@Test
public void testIsCompatible2() throws Exception {
RandomGenerator generator = new Well1024a();
Mutations<NucleotideSequence> muts = Mutations.decode("", NucleotideSequence.ALPHABET);
for (int i = 0; i < 100; i++) {
ClonalSequence c1 = createRandom(5 + generator.nextInt(10), generator);
Assert.assertTrue(c1.isCompatible(c1, muts));
}
}
use of org.apache.commons.math3.random.Well1024a in project tetrad by cmu-phil.
the class LargeScaleSimulation method getUncorrelatedGaussianShocks.
public double[][] getUncorrelatedGaussianShocks(int sampleSize) {
NormalDistribution normal = new NormalDistribution(new Well1024a(++seed), 0, 1);
int numVars = variableNodes.size();
setupModel(numVars);
double[][] shocks = new double[sampleSize][numVars];
for (int i = 0; i < sampleSize; i++) {
for (int j = 0; j < numVars; j++) {
shocks[i][j] = normal.sample() * sqrt(errorVars[j]);
}
}
return shocks;
}
Aggregations