Examples of random()


Examples of com.sun.faban.driver.util.Random.random()

    public void prepare() {
    id = getSequence() + 1;
        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        int count = r.random(2, 28);

        LinkedHashSet<Integer> friendSet = new LinkedHashSet<Integer>(count);
        for (int i = 0; i < count; i++) {
            int friendId;
            do { // Prevent friend to be the same user.
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        LinkedHashSet<Integer> friendSet = new LinkedHashSet<Integer>(count);
        for (int i = 0; i < count; i++) {
            int friendId;
            do { // Prevent friend to be the same user.
                friendId = r.random(1, ScaleFactors.users);
            } while (friendId == id || !friendSet.add(friendId));
        }

        friends = new int[friendSet.size()];
        int idx = 0;
View Full Code Here

Examples of org.apache.jcs.access.TestCacheAccess.random()

        throws Exception
    {
        // run a rondom operation test to detect deadlocks
        TestCacheAccess tca = new TestCacheAccess( "/TestBlockDiskCacheCon.ccf" );
        tca.setRegion( region );
        tca.random( range, numOps );

        // make sure a simple put then get works
        // this may fail if the other tests are flooding the disk cache
        JCS jcs = JCS.getInstance( region );
        String key = "testKey" + testNum;
View Full Code Here

Examples of org.apache.jcs.access.TestCacheAccess.random()

        throws Exception
    {
        // run a rondom operation test to detect deadlocks
        TestCacheAccess tca = new TestCacheAccess( "/TestDiskCacheCon.ccf" );
        tca.setRegion( region );
        tca.random( range, numOps );

        // make sure a simple put then get works
        // this may fail if the other tests are flooding the disk cache
        JCS jcs = JCS.getInstance( region );
        String key = "testKey" + testNum;
View Full Code Here

Examples of org.apache.sshd.common.Random.random()

        if (selected.isEmpty()) {
            log.warn("No suitable primes found, defaulting to DHG1");
            return getDH(new BigInteger(DHGroupData.getG()), new BigInteger(DHGroupData.getP1()));
        }
        Random random = session.getFactoryManager().getRandomFactory().create();
        int which = random.random(selected.size());
        Moduli.DhGroup group = selected.get(which);
        return getDH(group.p, group.g);
    }

    protected DH getDH(BigInteger p, BigInteger g) throws Exception {
View Full Code Here

Examples of org.apache.sshd.common.Random.random()

        }
        if (selected.isEmpty()) {
            throw new IllegalArgumentException("No suitable primes");
        }
        Random random = session.getFactoryManager().getRandomFactory().create();
        int which = random.random(selected.size());
        Moduli.DhGroup group = selected.get(which);
        return getDH(group.p, group.g);
    }

    protected DH getDH(BigInteger p, BigInteger g) throws Exception {
View Full Code Here

Examples of org.apache.sshd.common.Random.random()

        }
        if (selected.isEmpty()) {
            throw new IllegalArgumentException("No suitable primes");
        }
        Random random = session.getFactoryManager().getRandomFactory().create();
        int which = random.random(selected.size());
        Moduli.DhGroup group = selected.get(which);
        return getDH(group.p, group.g);
    }

    protected DH getDH(BigInteger p, BigInteger g) throws Exception {
View Full Code Here

Examples of org.jwildfire.create.tina.random.AbstractRandomGenerator.random()

    randGen.randomize(seed);
    q[centre][centre] = 1;
    double r1 = 3.0;
    double r2 = 3.0 * r1;
    for (int i = 0; i < _max_iter; i++) {
      double phi = pi2 * randGen.random();
      double ri = r1 * Math.cos(phi);
      double rj = r1 * Math.sin(phi);
      int ci = centre + (int) (ri + 0.5);
      int cj = centre + (int) (rj + 0.5);
      short qt = 0;
View Full Code Here

Examples of org.jwildfire.create.tina.random.AbstractRandomGenerator.random()

      double rj = r1 * Math.sin(phi);
      int ci = centre + (int) (ri + 0.5);
      int cj = centre + (int) (rj + 0.5);
      short qt = 0;
      while (qt == 0) {
        double rr = randGen.random();
        rr += rr;
        rr += rr;
        int rd = (int) rr;
        switch (rd) {
          case 0:
View Full Code Here

Examples of org.jwildfire.create.tina.random.MarsagliaRandomGenerator.random()

    randGen.randomize(seed);
    q[centre][centre] = 1;
    double r1 = 3.0;
    double r2 = 3.0 * r1;
    for (int i = 0; i < _max_iter; i++) {
      double phi = pi2 * randGen.random();
      double ri = r1 * Math.cos(phi);
      double rj = r1 * Math.sin(phi);
      int ci = centre + (int) (ri + 0.5);
      int cj = centre + (int) (rj + 0.5);
      short qt = 0;
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.