码迷,mamicode.com
首页 > Web开发 > 详细

jmetal随机数

时间:2020-04-23 23:16:43      阅读:66      评论:0      收藏:0      [点我收藏+]

标签:com   process   图片   metal   row   class   随机数   pac   一起   

jmetal随机数

觉得有用的话,欢迎一起讨论相互学习~

技术图片技术图片技术图片技术图片

  • util.PseudoRandom
import momfo.util.JMException;
import momfo.util.PseudoRandom;

import java.io.IOException;

public class TEST {
    public static void main(String args[]) throws IOException, JMException, ClassNotFoundException {
        double a;
        int b;
        System.out.println("a");
        for (int i = 0; i < 10; i++) {
            a = PseudoRandom.randDouble();//[0,1)之间Double随机数
            System.out.print(a + " ");
        }
        System.out.println();
        System.out.println("a1");
        for (int i = 0; i < 10; i++) {
            a = PseudoRandom.randDouble(4, 6);//[4,6)之间Double随机数
            System.out.print(a + " ");
        }
        System.out.println();
        System.out.println("b");
        for (int i = 0; i < 10; i++) {
            b = PseudoRandom.randInt();//[MIN,MAX]之间随机int
            System.out.print(b + " ");
        }
        System.out.println();
        System.out.println("b1");
        for (int i = 0; i < 10; i++) {
            b = PseudoRandom.randInt(4, 6);//[4,6]之间随机int
            System.out.print(b + " ");
        }
    }
}

//
//a
////0.893533005774213 0.07816513260530611 0.4869539933600744 0.8177769687753218 0.27544874565660105 0.23549831987694247 0.4124868700840816 0.6208565778763979 0.7339800276483693 0.4197640482615421
////a1
////4.417186276890425.1443996859577194.3048072730057145.1948812304726664.12414821704159355.5027963572952664.66940242119941654.5100300734152435.4021398661208075.8221029619629245
////b
////-1451235094 -574686162 -953159134 -649590219 -2123255381 -751852844 -606911126 -308175231 -1028890223 -883161670
////b1
////5 5 6 4 4 4 6 5 5 6
////Process finished with exit code 0
//

jmetal随机数

标签:com   process   图片   metal   row   class   随机数   pac   一起   

原文地址:https://www.cnblogs.com/cloud-ken/p/12764067.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!