Topic
2 replies Latest Post - ‏2013-03-08T21:33:45Z by SystemAdmin
SystemAdmin
SystemAdmin
1883 Posts
ACCEPTED ANSWER

Pinned topic Writing to a DB with no solution

‏2013-03-04T14:57:12Z |
Is it possible to use post-processing functions like dbUpdate/dbExecute before solving a problem ?
I would like to publish comments regarding successive steps of a OPL-script programm ( within a main() ): reading data, generating first LP, updating data, etc....

I cannot use dbupdate or dbexecute directly in the "main", and if I try to call a ".dat file" before any solution exists an error pops up (eventhough I am not using any element of the solution for that type of publication).

Thanks
Updated on 2013-03-08T21:33:45Z at 2013-03-08T21:33:45Z by SystemAdmin
  • AlexFleischer
    AlexFleischer
    1068 Posts
    ACCEPTED ANSWER

    Re: Writing to a DB with no solution

    ‏2013-03-04T17:09:18Z  in response to SystemAdmin
    Hi,

    to do that what you can do is do a fake solve,a solve that does nothing but lets you call postprocess.

    Let me give you an example:

    .mod

    int a[i in 1..3]=2*i;
     
    subject to
    {
      
    }
     
    main
    {
     thisOplModel.generate();
     cplex.solve();
     thisOplModel.postProcess(); 
    }
    


    .dat

    SheetConnection sheet("oilSheet.xls");
    a to SheetWrite(sheet,"RESULT!A2:A4");
    
    Updated on 2014-03-26T05:50:38Z at 2014-03-26T05:50:38Z by AlexFleischer