Package org.jamesii.core.math.random.generators

Examples of org.jamesii.core.math.random.generators.IRandom.nextDouble()


        if (partition != null && partition.containsKey(i)) {
          int p = partition.get(i);

          if (p >= usedColors.size()) {
            for (int k = usedColors.size(); k <= p; k++) {
              usedColors.add(rand.nextDouble() + " " + rand.nextDouble() + " "
                  + rand.nextDouble());
            }
          }

          file.write("node [color=\"" + usedColors.get(p) + "\"];\n");
View Full Code Here


        if (partition != null && partition.containsKey(i)) {
          int p = partition.get(i);

          if (p >= usedColors.size()) {
            for (int k = usedColors.size(); k <= p; k++) {
              usedColors.add(rand.nextDouble() + " " + rand.nextDouble() + " "
                  + rand.nextDouble());
            }
          }

          file.write("node [color=\"" + usedColors.get(p) + "\"];\n");
View Full Code Here

          int p = partition.get(i);

          if (p >= usedColors.size()) {
            for (int k = usedColors.size(); k <= p; k++) {
              usedColors.add(rand.nextDouble() + " " + rand.nextDouble() + " "
                  + rand.nextDouble());
            }
          }

          file.write("node [color=\"" + usedColors.get(p) + "\"];\n");
        }
View Full Code Here

    // If larger than allowed: dismiss jobs randomly
    IRandom random = SimSystem.getRNGGenerator().getNextRNG();
    int deleteJobs = compJobs.size() - maxJobs;
    for (int i = 0; i < deleteJobs; i++) {
      compJobs.remove((int) (random.nextDouble() * compJobs.size()));
    }
    return compJobs;
  }

  /**
 
View Full Code Here

   */
  protected Double[][] generateMatrix(int numOfAlgo, int numOfProb,
      int minPerformance, int maxPerformance) {
    IRandom rng = SimSystem.getRNGGenerator().getNextRNG();
    if (numOfAlgo == 0) {
      numOfAlgo = (int) (991 * rng.nextDouble() + 10);
    }
    if (numOfProb == 0) {
      numOfProb = (int) (991 * rng.nextDouble() + 10);
    }
    UniformDistribution u =
View Full Code Here

    IRandom rng = SimSystem.getRNGGenerator().getNextRNG();
    if (numOfAlgo == 0) {
      numOfAlgo = (int) (991 * rng.nextDouble() + 10);
    }
    if (numOfProb == 0) {
      numOfProb = (int) (991 * rng.nextDouble() + 10);
    }
    UniformDistribution u =
        new UniformDistribution(rng, minPerformance, maxPerformance + 1);
    Double[][] matrix = new Double[numOfAlgo][numOfProb];
    for (Double[] mat : matrix) {
View Full Code Here

    eles = 1000;
    // The seed -7538847116595691071l caused a problem in one of the queues
    // (with at least 1000 and 10000 eles)
    IRandom rand = new JavaRandom(-7538847116595691071l);
    for (int i = 0; i < eles; i++) {
      myQueue.enqueue(new Object(), tim + rand.nextDouble());
    }

    // get the min
    Double ti = myQueue.getMin();
    // remember the queue size
View Full Code Here

    Double[][] problemMatrixNull =
        new Double[problemMatrix.length][problemMatrix[0].length];
    for (int i = 0; i < problemMatrix.length; i++) {
      for (int j = 0; j < problemMatrix[0].length; j++) {
        problemMatrixNull[i][j] = problemMatrix[i][j];
        if ((int) (rng.nextDouble() * 100) < NULL_PERCENTAGE) {
          problemMatrixNull[i][j] = null;
        }
      }
    }
    gaps.setAbortCriterion(new GenerationCountAbort(GEN_COUNT));
View Full Code Here

   */
  protected Double[][] generateMatrix(int numOfAlgo, int numOfProb,
      int minPerformance, int maxPerformance) {
    IRandom rng = SimSystem.getRNGGenerator().getNextRNG();
    if (numOfAlgo == 0) {
      numOfAlgo = (int) (991 * rng.nextDouble() + 10);
    }
    if (numOfProb == 0) {
      numOfProb = (int) (991 * rng.nextDouble() + 10);
    }
    UniformDistribution u =
View Full Code Here

    IRandom rng = SimSystem.getRNGGenerator().getNextRNG();
    if (numOfAlgo == 0) {
      numOfAlgo = (int) (991 * rng.nextDouble() + 10);
    }
    if (numOfProb == 0) {
      numOfProb = (int) (991 * rng.nextDouble() + 10);
    }
    UniformDistribution u =
        new UniformDistribution(rng, minPerformance, maxPerformance + 1);
    Double[][] matrix = new Double[numOfAlgo][numOfProb];
    for (Double[] mat : matrix) {
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.