Examples of IRandom


Examples of org.jamesii.core.math.random.generators.IRandom

   * @see org.jamesii.core.model.variables.IQualitativeVariable#setRandomValue()
   */
  @Override
  public void setRandomValue() {

    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    int rand1 = r1.nextInt(getCategories().size());

    setValue(getCategory(rand1));
  }
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

    return getValue().add(addVal);
  }

  @Override
  public void setRandomValue() {
    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    double rand1 = r1.nextDouble();

    if (getLowerBound() == null) {
      setLowerBound(new BigDecimal(Double.MIN_VALUE));
    }
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

    return (int) newVal;
  }

  @Override
  public void setRandomValue() {
    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    int rand1;
    int increment = 1;

    if (getUpperBound() == null) {
      setUpperBound(Integer.MAX_VALUE / 2);
      increment = 0;
    }
    if (getLowerBound() == null) {
      setLowerBound(Integer.MIN_VALUE / 2);
    }

    rand1 = r1.nextInt(getUpperBound() - getLowerBound() + increment);

    rand1 += getLowerBound();

    setValue(rand1);
  }
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

    if (getUpperBound() == null) {
      setUpperBound(Float.MAX_VALUE / 2);
    }

    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    float rand1 = r1.nextFloat();

    setValue(getLowerBound() + (getUpperBound() - getLowerBound()) * rand1);
  }
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

    return (short) newVal;
  }

  @Override
  public void setRandomValue() {
    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    double rand1 = r1.nextDouble();

    if (getLowerBound() == null) {
      setLowerBound(Short.valueOf(Short.MIN_VALUE));
    }
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

    return Math.round(getValue() + factor * getStepWidth());
  }

  @Override
  public void setRandomValue() {
    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    long rand1 = r1.nextLong();

    if (getLowerBound() == null) {
      setLowerBound(Long.MIN_VALUE / 2);
    }

View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

    return getValue().add(addVal.toBigInteger());
  }

  @Override
  public void setRandomValue() {
    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    double rand1 = r1.nextDouble();

    if (getLowerBound() == null) {
      setLowerBound(new BigInteger(String.valueOf(Long.MIN_VALUE)));
    }
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

   *           Signals that an I/O exception has occurred.
   */
  public static void saveGraphToDOT(String fileName,
      ILabeledGraph<Integer, ?, Double, Double> graph,
      Map<Integer, Integer> partition) throws IOException {
    IRandom rand = SimSystem.getRNGGenerator().getNextRNG();
    try (FileWriter file = new FileWriter(fileName)) {
      int vertexCount = graph.getVertexCount();
      Map<Integer, Double> vertexLabels = graph.getVertexLabels();
      Map<Integer, Map<Integer, Double>> edgeLabels = graph.getEdgeLabels();
      List<List<Integer>> adjacencyLists = graph.getAdjacencyLists();
View Full Code Here

Examples of org.jamesii.core.math.random.generators.IRandom

    if (getUpperBound() == null) {
      setUpperBound(Double.MAX_VALUE / 2);
    }

    IRandom r1 = SimSystem.getRNGGenerator().getNextRNG();
    double rand1 = r1.nextDouble();

    rand1 = getLowerBound() + (getUpperBound() - getLowerBound()) * rand1;

    this.setValue(rand1);
  }
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.