Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

IloNumtoNumStepFunction array setting

  • 1.  IloNumtoNumStepFunction array setting

    Posted Mon August 14, 2017 09:51 PM

    Originally posted by: Laser.Cho


    Hi. I made a code, but there is quite terrible code. This is 2 workers calendar function.  

     

    ///=================

    IloNumToNumStepFunction WORKER0(env,0,999,100); // worker 0 is for Joe, 1 is for Jim

    IloNumToNumStepFunction WORKER1(env, 0, 999, 100); // worker 1 is Jim

    //==============

     

    for efficient, I want to make it as array. Like this.

     

    //===============

    IloNumToNumStepFunction WORKER[2]; // worker 0 is for Joe, 1 is for Jim

    for(int i=0;i<2;i++)

        WORKER[i].setBLAH BLAH (env,0,999,100); 

     

     

    But it doesn't work.

    I can make step function array, But I cannot set their env, (Oh, I can set their Min ans Max)

     

    How can I use stepFunction array? 


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: IloNumtoNumStepFunction array setting

    Posted Fri August 18, 2017 05:28 AM

    Originally posted by: Laser.Cho


    Self Answer.

     

        typedef IloArray<IloNumToNumStepFunction> WORKER_calendar_array;
        WORKER_calendar_array WORKER(env, 2);
        WORKER[0] = IloNumToNumStepFunction(env, 0, 999, 100);
        WORKER[1] = IloNumToNumStepFunction(env, 0, 999, 100);


    #CPOptimizer
    #DecisionOptimization