Examples of MersenneTwisterRNG


Examples of org.uncommons.maths.random.MersenneTwisterRNG

  public void testTrainingTestingSets() throws IOException {
    int n = 20;

    for (int nloop = 0; nloop < n; nloop++) {
      long datasetSize = 100;
      MersenneTwisterRNG rng = new MersenneTwisterRNG();
      byte[] seed = rng.getSeed();
      double threshold = rng.nextDouble();

      JobConf conf = new JobConf();
      RndLineRecordReader rndReader;
      Set<Long> dataset = new HashSet<Long>();
      LongWritable key = new LongWritable();
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

  public void testStoreJobParameters() {
    int n = 20;

    for (int nloop = 0; nloop < n; nloop++) {
      MersenneTwisterRNG rng = new MersenneTwisterRNG();

      byte[] seed = rng.getSeed();
      double threshold = rng.nextDouble();
      boolean training = rng.nextBoolean();

      DatasetSplit split = new DatasetSplit(seed, threshold);
      split.setTraining(training);

      JobConf conf = new JobConf();
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

public class CDMahoutEvaluatorTest extends TestCase {

  public void testEvaluate() throws Exception {
    int nbrules = 100;
    Random rng = new MersenneTwisterRNG();
    int target = 1;

    // random rules
    List<Rule> rules = new ArrayList<Rule>();
    for (int index = 0; index < nbrules; index++) {
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

  Random rng;

  @Override
  protected void setUp() {
    rng = new MersenneTwisterRNG();
  }
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

        dataset, target, split);
    // Selection Strategy
    SelectionStrategy<? super CDRule> selection = new RouletteWheelSelection();

    EvolutionEngine<CDRule> engine = new SequentialEvolutionEngine<CDRule>(factory,
        pipeline, evaluator, selection, new MersenneTwisterRNG());

    engine.addEvolutionObserver(new EvolutionObserver<CDRule>() {
      @Override
      public void populationUpdate(PopulationData<? extends CDRule> data) {
        log.info("Generation {}", data.getGenerationNumber());
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

  private UncommonDistributions() {
  }

  public static void init(byte[] seed) {
    random = new MersenneTwisterRNG(seed);
  }
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

   *         cities once.
   */
  @Override
  public List<String> calculateShortestRoute(Collection<String> cities,
      final ProgressListener progressListener) {
    Random rng = new MersenneTwisterRNG();

    // Set-up evolution pipeline (cross-over followed by mutation).
    List<EvolutionaryOperator<? super List<?>>> operators = new ArrayList<EvolutionaryOperator<? super List<?>>>(
        2);
    if (crossover) {
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

    this.threshold = threshold;
    this.training = true;
  }

  public DatasetSplit(double threshold) {
    this(new MersenneTwisterRNG().getSeed(), threshold);
  }
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

      this.reader = reader;

      DatasetSplit split = new DatasetSplit(conf);

      rng = new MersenneTwisterRNG(split.getSeed());
      threshold = split.getThreshold();
      training = split.isTraining();
    }
View Full Code Here

Examples of org.uncommons.maths.random.MersenneTwisterRNG

   * <br>
   * Make sure that evaluate() is not called twice for the same population.
   */
  public void testEvaluateSamePopulation() {
    STFitnessEvaluatorMock<Integer> mock = new STFitnessEvaluatorMock<Integer>();
    Random rng = new MersenneTwisterRNG();

    int size = 100;
    List<Integer> population = randomInts(size, rng);

    List<Double> evaluations = randomFloats(size, rng);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.