Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  Random real and integer numbers

    Posted Wed February 01, 2012 01:18 PM

    Originally posted by: matrus2


    I have found troubles with generating random numbers in a main block. I use a random.math() function for geting a new data set, but the values I get, are the same. Just look at my results:

    math.random()*1000 math.random()*100 math.random()*10
    19629,1626 1962,91626 196,291626
    38778,02734 3877,802734 387,7802734

    Each of these is an average of 10 non related tests were the input data is declared:

    for (var nnn=1;nnn<=ilN;nnn++){
    for (var scen=1;scen<=ilS;scen++){
    masterData.sscennnn=Math.random()*1000;
    }
    }

    How it is possible? I have noticed that if I run program first time I always get the same random numbers.

    On the other hand is there any way to generate integer random numbers in the main block? I can not find solution.

    I hope the problem is decribed briefly, but if not - please do not hestitate to contact me any time.
    Thank you.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Random real and integer numbers

    Posted Wed February 01, 2012 01:26 PM

    Originally posted by: SystemAdmin


    I think this thread answers you question:
    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14776763
    #DecisionOptimization
    #OPLusingCPLEXOptimizer