Package org.apache.commons.math3.random

Examples of org.apache.commons.math3.random.MersenneTwister


    return new DefaultSupplierRng<Solver>() {
      @Override
      public Solver get(long seed) {
        return SolverValidator.wrap(new MultiVehicleSolverAdapter(
            ArraysSolverValidator.wrap(new RandomMVArraysSolver(
                new MersenneTwister(seed))), NonSI.MINUTE));
      }
    };
  }
View Full Code Here


   * are treated correctly by the conversion script.
   */
  @Test
  public void testToInventoriesArrayWithDuplicatePositions() {

    final Simulator sim = new Simulator(new MersenneTwister(123),
        Measure.valueOf(1000L, SI.MILLI(SI.SECOND)));

    sim.register(new DefaultPDPModel());
    sim.register(new PDPRoadModel(new PlaneRoadModel(new Point(0, 0),
        new Point(10, 10), 50), false));
View Full Code Here

    }
    checkState(dataSetDir.exists() || dataSetDir.mkdir());

    final DateTimeFormatter formatter = ISODateTimeFormat
        .dateHourMinuteSecondMillis();
    final RandomGenerator rng = new MersenneTwister(123);

    // 480 minutes or 8 hours
    final long dayLength = 480L;
    // 0.1 vehicle per km2
    final double vehicleDensity = .1d;
View Full Code Here

   * @param models An optional list of models which can be added, with this
   *          option custom models for specific solutions can be added.
   */
  public DynamicPDPTWProblem(final DynamicPDPTWScenario scen, long randomSeed,
      Model<?>... models) {
    simulator = new Simulator(new MersenneTwister(randomSeed), Measure.valueOf(
        scen.getTickSize(), scen.getTimeUnit()));
    simulator.register(scen.createRoadModel());
    simulator.register(scen.createPDPModel());
    for (final Model<?> m : models) {
      simulator.register(m);
View Full Code Here

     
      // get the reconstruction row that matches this image
      Matrix reconstructed_row_image = MatrixUtils.viewRowAsMatrix(reconstruct_all, j);
     
      // now generate a new image based on the reconstruction probabilities
      Matrix draw2 = MatrixUtils.genBinomialDistribution( reconstructed_row_image, 1, new MersenneTwister(123) ).times(255);
   
      if (toDisk) {
       
//        System.out.println("Label: " + input.get(j).getSecond().viewRow(0).maxValueIndex() );
  //      MatrixUtils.debug_print( input.get(j).getSecond() );
View Full Code Here

  }
 
  @Test
  public void testMnist() throws Exception {
    MnistDataSetIterator fetcher = new MnistDataSetIterator(100,200);
    MersenneTwister rand = new MersenneTwister(123);

    double learningRate = 0.001;
   
    int[] batchSteps = { 250, 200, 150, 100, 50, 25, 5 };
   
View Full Code Here

   
    int numIns = recordBatch.getFirst().numCols();
    int numLabels = recordBatch.getSecond().numCols();

    int n_layers = hiddenLayerSizes.length;
    RandomGenerator rng = new MersenneTwister(123);
   
   
    DeepBeliefNetwork dbn = new DeepBeliefNetwork( numIns, hiddenLayerSizes, numLabels, n_layers, rng ); //, Matrix input, Matrix labels);
       
    dbn.useRegularization = false;
View Full Code Here

    DataSet first = fetcher.next();
    int numIns = first.getFirst().numCols();
    int numLabels = first.getSecond().numCols();

    int n_layers = hiddenLayerSizes.length;
    RandomGenerator rng = new MersenneTwister(123);
   
   
    DeepBeliefNetwork dbn = new DeepBeliefNetwork( numIns, hiddenLayerSizes, numLabels, n_layers, rng ); //, Matrix input, Matrix labels);
       
    dbn.useRegularization = false;
View Full Code Here

 
 
  @Test
  public void testMatrixBinomialGeneration() {

    RandomGenerator g = new MersenneTwister(123);
   
    Matrix m0 = new DenseMatrix(1, 3);
    m0.setQuick(0, 0, 0.5);
    m0.setQuick(0, 1, 0.5);
    m0.setQuick(0, 2, 0.1);
View Full Code Here

 
 
  @Test
  public void testUniform() {
   
    RandomGenerator g = new MersenneTwister(123);
   
    Matrix u = MatrixUtils.uniform(g, 3, 4);
   
    assertEquals(3, u.numRows());
    assertEquals(4, u.numCols());
View Full Code Here

TOP

Related Classes of org.apache.commons.math3.random.MersenneTwister

Copyright © 2018 www.massapicom. 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.