Examples of random()


Examples of DistLib.uniform.random()

  uniform PRNG = new uniform();

  for(int i=0; i<10; i++)
      //System.err.println( normal.random(0.0,1.0, PRNG) );
        System.err.println( PRNG.random() );
    }

}
View Full Code Here

Examples of com.asakusafw.compiler.flow.testing.operator.ExOperatorFactory.random()

    @Override
    protected void describe() {
        ExOperatorFactory f = new ExOperatorFactory();
        CoreOperatorFactory core = new CoreOperatorFactory();
        Random rand = f.random(in);
        Cogroup cog1 = f.cogroup(rand.out, core.empty(Ex2.class));
        Cogroup cog2 = f.cogroup(rand.out, core.empty(Ex2.class));
        out.add(cog1.r1);
        out.add(cog2.r1);
        core.stop(cog1.r2);
View Full Code Here

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

        Random r = tr.getRandom();
        StringBuilder buffer = tr.getBuffer();
        fields[0] = RandomUtil.randomText(r, 15, 20); //title
        fields[1] = RandomUtil.randomText(r, 15, 50); //summary
        fields[2] = RandomUtil.randomText(r, 50, 495); // description
        fields[3] = UserName.getUserName(r.random(1, ScaleFactors.users)); //submitterUserName
        fields[4] = "e" + id + ".jpg"; // imageurl
        fields[5] = "e" + id + "t.jpg"; // imagethumburl
        fields[6] = "e" + id + "l.pdf"; //literatureurl
        fields[7] = RandomUtil.randomPhone(r, buffer); //phone
        DateFormat dateFormat = tr.getDateFormat(); // eventtimestamp
View Full Code Here

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

        fields[6] = "e" + id + "l.pdf"; //literatureurl
        fields[7] = RandomUtil.randomPhone(r, buffer); //phone
        DateFormat dateFormat = tr.getDateFormat(); // eventtimestamp
        String eventDate = dateFormat.format(
                    r.makeDateInInterval(BASE_DATE, 0, 540));
        int eventHr = r.random(7, 21);
        String eventMin = EVT_MINUTES[r.random(0, 3)]// eventtimestamp
        fields[8] = String.format("%s %02d:%s:00",
                                            eventDate, eventHr, eventMin);

        createdTimestamp = r.makeDateInInterval( //createdtimestamp
View Full Code Here

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

        fields[7] = RandomUtil.randomPhone(r, buffer); //phone
        DateFormat dateFormat = tr.getDateFormat(); // eventtimestamp
        String eventDate = dateFormat.format(
                    r.makeDateInInterval(BASE_DATE, 0, 540));
        int eventHr = r.random(7, 21);
        String eventMin = EVT_MINUTES[r.random(0, 3)]// eventtimestamp
        fields[8] = String.format("%s %02d:%s:00",
                                            eventDate, eventHr, eventMin);

        createdTimestamp = r.makeDateInInterval( //createdtimestamp
                                        BASE_DATE, -540, 0);
View Full Code Here

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

        fields[8] = String.format("%s %02d:%s:00",
                                            eventDate, eventHr, eventMin);

        createdTimestamp = r.makeDateInInterval( //createdtimestamp
                                        BASE_DATE, -540, 0);
        ifields[0] = r.random(1, ScaleFactors.users); // addressId
        // The rest is initialized to 0 anyway, leave it that way.
    }
   
     public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
View Full Code Here

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

        id = getSequence();
        ++id;
        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        //userName = UserName.getUserName(id);
        int count = r.random(2, 28);
      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()

      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 String[friendSet.size()];
        //int idx = 0;
View Full Code Here

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

    public void prepare() {
        eventId = getSequence();
        ++eventId;
        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        int commentCount = r.random(0, 20);
        userNames = new String[commentCount];
        comments = new String[commentCount];
        ratings = new int[commentCount];
        for (int i = 0; i < userNames.length; i++) {
            int userId = r.random(1, ScaleFactors.users);
View Full Code Here

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

        int commentCount = r.random(0, 20);
        userNames = new String[commentCount];
        comments = new String[commentCount];
        ratings = new int[commentCount];
        for (int i = 0; i < userNames.length; i++) {
            int userId = r.random(1, ScaleFactors.users);
            userNames[i] = UserName.getUserName(userId);
            comments[i] = r.makeCString(10, 1000);
            ratings[i] = r.random(2, 5);          
        }
    created_at = r.makeDateInInterval( BASE_DATE, -540, 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.