• jmetal随机数


    jmetal随机数

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

    我的微博我的github我的B站

    • 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
    //
    
    
  • 相关阅读:
    JSTL之迭代标签库
    java中的IO流
    浅谈代理模式
    TreeSet集合
    网络编程之UDP协议
    Java中的多线程
    Java中的面向对象
    JavaScript 函数表达式
    JavaScript 数据属性和访问器属性
    JavaScript 正则表达式语法
  • 原文地址:https://www.cnblogs.com/cloud-ken/p/12764067.html
Copyright © 2020-2023  润新知