Examples of nextLong()


Examples of java.util.Random.nextLong()

   
    TimerTask[] tasks = new TimerTask[1000];
    Random random = new Random();
    for (int i = 0; i < tasks.length; i++)
    {
      tasks[i] = new TimerTask(null, Math.abs(random.nextLong()));
      list.addTimer(tasks[i]);
    }
   
    long time = -1;
   
View Full Code Here

Examples of java.util.Random.nextLong()

    {
      assertTrue(task.getExecutionTime() >= time);
      time = task.getExecutionTime();
    }
   
    time = Math.abs(random.nextLong());
   
    TimerTask task = null;
    while ((task = list.getExpired(time)) != null)
    {
      assertTrue(task.getExecutionTime() <= time);
View Full Code Here

Examples of java.util.Random.nextLong()

        tHandle.setTranslatedObjectDataMask((byte) primaryMask);
       
        //
        if(tHandle.generateUID()){
            Random random = new Random();
            transactionFile.writeLong(random.nextLong());
        }
        long time = System.currentTimeMillis();
        if(tHandle.generateCreationTS()){
            transactionFile.writeLong(time);
        }
View Full Code Here

Examples of java.util.Scanner.nextLong()

    }

    try {
      // Get the recorded dfsUsed from the file.
      if (sc.hasNextLong()) {
        cachedDfsUsed = sc.nextLong();
      } else {
        return -1;
      }
      // Get the recorded mtime from the file.
      if (sc.hasNextLong()) {
View Full Code Here

Examples of jmt.engine.random.engine.MersenneTwister.nextLong()

  @Override
  public void createValuesSet() {
    MersenneTwister generator = new MersenneTwister();
    generator.setNewSeed(simDef.getSimulationSeed().longValue());
    for (int i = 0; i < numberOfSteps; i++) {
      values.add(new Long(generator.nextLong()));
    }
    originalValues = simDef.getSimulationSeed();
  }

  /**
 
View Full Code Here

Examples of org.apache.commons.math.random.RandomData.nextLong()

    if (range.getMinimumNumber() instanceof Integer && range.getMaximumNumber() instanceof Integer) {
      result = randomData.nextInt(range.getMinimumInteger(), range.getMaximumInteger());
    }

    if (range.getMinimumNumber() instanceof Long && range.getMaximumNumber() instanceof Long) {
      result = randomData.nextLong(range.getMinimumLong(), range.getMaximumLong());
    }

    if (range.getMinimumNumber() instanceof Float && range.getMaximumNumber() instanceof Float) {
      result = randomData.nextUniform(range.getMinimumFloat(), range.getMaximumFloat());
    }
View Full Code Here

Examples of org.apache.commons.math.random.RandomDataImpl.nextLong()

    if (range.getMinimumNumber() instanceof Integer && range.getMaximumNumber() instanceof Integer) {
      result = randomData.nextInt(range.getMinimumInteger(), range.getMaximumInteger());
    }

    if (range.getMinimumNumber() instanceof Long && range.getMaximumNumber() instanceof Long) {
      result = randomData.nextLong(range.getMinimumLong(), range.getMaximumLong());
    }

    if (range.getMinimumNumber() instanceof Float && range.getMaximumNumber() instanceof Float) {
      result = randomData.nextUniform(range.getMinimumFloat(), range.getMaximumFloat());
    }
View Full Code Here

Examples of org.apache.commons.math3.random.MersenneTwister.nextLong()

        .parse()
        .get(0);

    final RandomGenerator rng = new MersenneTwister(123);
    for (int i = 0; i < 5; i++) {
      final long seed = rng.nextLong();
      final DebugSolverCreator dsc = new DebugSolverCreator(seed,
          scenario.getTimeUnit());
      final Gendreau06ObjectiveFunction obj = new Gendreau06ObjectiveFunction();
      final ExperimentResults results = Experiment.build(obj)
          .addConfiguration(Central.solverConfiguration(dsc))
View Full Code Here

Examples of org.apache.commons.math3.random.RandomGenerator.nextLong()

    @Test
    public void testFloorDivModLong() {
        RandomGenerator generator = new Well1024a(0xb87b9bc14c96ccd5l);
        for (int i = 0; i < 10000; ++i) {
            long a = generator.nextLong();
            long b = generator.nextLong();
            if (b == 0) {
                try {
                    FastMath.floorDiv(a, b);
                    Assert.fail("an exception should have been thrown");
View Full Code Here

Examples of org.apache.commons.math3.random.Well1024a.nextLong()

    @Test
    public void testFloorDivModLong() {
        RandomGenerator generator = new Well1024a(0xb87b9bc14c96ccd5l);
        for (int i = 0; i < 10000; ++i) {
            long a = generator.nextLong();
            long b = generator.nextLong();
            if (b == 0) {
                try {
                    FastMath.floorDiv(a, b);
                    Assert.fail("an exception should have been thrown");
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.