/** * Replacement function for nextBoolean * * @return a boolean. */ public static boolean nextBoolean() { wasAccessed = true; return nextInt(1)!=0; }
/** * Replacement function for nextInt * * @param max * a int. * @return a int. */ public int nextInt(int max) { return org.evosuite.runtime.Random.nextInt(max); }
/** * Replacement function for nextInt * * @return a int. */ public int nextInt() { return org.evosuite.runtime.Random.nextInt(); }
/** * Replacement function for nextInt * * @return a int. */ public int nextInt() { return org.evosuite.runtime.Random.nextInt(); }
/** * Replacement function for nextInt * * @param max * a int. * @return a int. */ public int nextInt(int max) { return org.evosuite.runtime.Random.nextInt(max); }
/** * Replacement function for nextBytes * @param bytes */ public static void nextBytes(byte[] bytes) { wasAccessed = true; for (int i = 0; i < bytes.length; ) for (int rnd = nextInt(), n = Math.min(bytes.length - i, 4); n-- > 0; rnd >>= 8) bytes[i++] = (byte)rnd; }
/** {@inheritDoc} */ @Override public TestSuiteChromosome getChromosome() { /* * double P_delta = 0.1d; double P_clone = 0.1d; int MAX_CHANGES = 10; */ TestSuiteChromosome chromosome = defaultFactory.getChromosome(); int numTests = chromosome.getTests().size(); //reduce seed probablility by number of tests to be generated final double SEED_CHANCE = Properties.SEED_PROBABILITY / numTests; for (int i = 0; i < numTests; i++) { if (geneticAlgorithm != null && Randomness.nextDouble() < SEED_CHANCE) { int populationSize = geneticAlgorithm.getPopulation().size(); TestSuiteChromosome tsc = geneticAlgorithm.getPopulation().get(Randomness.nextInt(populationSize)); int testSize = tsc.getTests().size(); TestCase test = tsc.getTests().get(Random.nextInt(testSize)); if (test != null) { List<TestCase> tests = chromosome.getTests(); tests.remove(i); tests.add(i, test); chromosome.clearTests(); for (TestCase t : tests){ chromosome.addTest(t); } } } } return chromosome; }
TestCase test = bi.getTests().get(Random.nextInt(testSize)); if (test != null) { List<TestCase> tests = chromosome.getTests();