Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  generate release time randomly

    Posted 08/10/20 10:12 AM

    I wanna to generate release time randomly and make the trains' departure time equals to it. I write it as follows and I got something wrong with assignment statement.

    execute {
    cplex.tilim = 120;
    for (var k in orders)
      { writeln("\n origin release time is"+k.release_time);   
          k.release_time = Opl.rand(7);    // This is wrong.
         }    
    }

    my data file is :
                                                         // volume due_time release_time
    orders = {<1, {"Beijing"},{"Hamburg"},   24,       26,               0>,
                   <2, {"Yinchuan"},{"Hamburg"}, 26,     20,               0>,
                   <3, {"Shanghai"},{"Hamburg"}, 18,     28,               0> };

    Is it because I already define the value of release time in data file?  How can I change it ?  I need to change the release time of every order in each iteration.

    Regards


    Programmer
    ------------------------------
    Junaid - Ainit Dubai
    ------------------------------

    #DecisionOptimization


  • 2.  RE: generate release time randomly