Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Updating variables and feeding back into solution

    Posted 03/13/17 04:41 AM

    Originally posted by: Hary18338


    Hi,

    I have written a smalleg.mod file which calculates a variable "WorkloadGuess" and uses this in an objective function to get a minimum solution. I am receiving a valid solution, however, now my challenge is to update the variale WorkloadGuess in my main file with "newGuess" and then insert this back into the solver for a new solution. I have the following problem:

    When I update WorkloadGuess with newGuess and resolve, the variables do not update. I receive the same guess and the same solution each time. I believe my method of saving the updqated variable and regenerating the model is not correct but am not sure how it should be done.

    I am attaching my main, .dat and .mod files here. Any help would be much appreicated.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Updating variables and feeding back into solution



  • 3.  Re: Updating variables and feeding back into solution

    Posted 03/13/17 08:40 AM

    Originally posted by: Hary18338


    Hi Alex,

    Thanks for your answer. I have implemented the code as in the example you sent me. I am however receiving the error "reference to a deleted object". I think the reason is, the example has only one variable in the data file but I have many others. Therefore when I introduce a new IlopOplDataElements() the other variables are not anymore there. Are you able to tell me if this is right, and how I can fix it?

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Updating variables and feeding back into solution

    Posted 03/13/17 09:32 AM

    Originally posted by: Hary18338


    Hi Alex,

    Here is my last attempt. In line 135 of the main file you can see that WorkloadGuess is being updated but not being passed on in the next solve. I have created a new IloOplDataElements() as in the IBM documentation but this is not working. Any help would be much appreciated.

    Regards,

    Harry


    #DecisionOptimization
    #OPLusingCPLEXOptimizer