Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Discrete-Time Formulations Based on Pulse Start Variables

    Posted Wed May 22, 2019 08:39 AM

    Originally posted by: AnushKara


    Hello everyone,

     

    I am a beginner in using CPLEX optimization studio. I want to formulate the Resource-Constrained Project Scheduling Problem (RCPSP) as a mixed integer linear optimization problem by implementing the Discrete-Time Formulations Based on "Pulse" Start Variables in the aggregated and the disaggregated version. I have excel data containing 48 instances (sheets), each containing 30 activities. Here my excel structure(attached a small screenshot of the sheet outlook):

    - 32 is number of activities (including dummy start and finish activities)

    - 4 is number of resources

    - 24,23,25,33 are capacities for each resource

    - the lines above with the following order: duration of activity; the requirement of resources 1,2,3,4 respectively for the activity; the number of direct successors for the activity; activity IDs of all successors for the activity under consideration. 

       

     

    I am attaching my model and data file. In the data file you can see that I worked on some instances manually inputted and the model works fine for those instances. However, as I mentioned above, I have a problem retrieving all the instances from excel sheets and running them simultaneously.  I hope you can help me with this issue and thank you very much in advance for the consideration and help. 

     

    Kind regards,

    Anush

     

     

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Discrete-Time Formulations Based on Pulse Start Variables



  • 3.  Re: Discrete-Time Formulations Based on Pulse Start Variables

    Posted Thu May 23, 2019 03:54 PM

    Originally posted by: AnushKara


    Hi,

    Thank you very much. I followed the zoo example. My model works now but only for one instance. And actually I worked the zoo example and I only get the result of one objective as it also runs for one instance/sheet (with number of Kids = 300). So, could you please look at the code which I downloaded for the zoo example and tell what is wrong so that from this zoo example I can update my model as well. Thank you very much in advance.

     

    Moreover, 

    I want to extract the results to my excel sheet. And I also need solving time information. Here is the code I am using to get the information.

     

    float temp;
    execute{
    var before = new Date();
    temp = before.getTime();
    }
    execute timeTermination {
    cplex.tilim = 600;
    }

    execute{

    var after = new Date();
    writeln("Solving time ~= ",(after.getTime()-temp)/1000);
    }

     

    However, I need to extract it and use SheetWrite command and here is my try for it but it doesn't work:

    Solving time to SheetWrite (ExcelData,"Results!C7"); -- I get error as there is no Solving time defined. 

    Can you please help me with this as well?

     

    Thanks a lot!

    Anush


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Discrete-Time Formulations Based on Pulse Start Variables

    Posted Fri May 24, 2019 01:34 PM

    hi,

    in the postprocess I added

    float costResult;
    float solvetime;

    execute
    {
    writeln(results);
    writeln("cost = ",cplex.getObjValue());
    costResult=cplex.getObjValue();
    solvetime=cplex.getSolvedTime();
    }

    and now I get

    {<40 6> <30 2>}
    cost = 3800
     {<40 7> <30 1>}
    cost = 3900
     {<40 8> <30 0>}
    cost = 4000

    and I get that in the excel spreadsheet

     

    regards

     

    PS:

    https://medium.com/@alexfleischer_84755/optimization-simply-do-more-with-less-zoo-buses-and-kids-66940178db6

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer