Decision Optimization

 View Only
  • 1.  How can I run an "existed" cplex program from c# code?

    Posted Tue July 07, 2020 04:51 AM
    Hi,

    I am the student working with CPLEX in C#, through the .Net interface.
    I would like to run an "existed" cplex progrm from C# code.

    But I only find           Cplex cplexModel = new Cplex();             to create a new empty cplex model.

    So my question is simply : How can I use the C# .Net to run an "existed" Cplex model and get the var. and obj.value. 

    Best regards,
    Barry

    ------------------------------
    盛翔 范
    ------------------------------

    #DecisionOptimization


  • 2.  RE: How can I run an "existed" cplex program from c# code?

    Posted Tue July 07, 2020 05:54 AM
    Hi,

    you have many examples on how to call an OPL model from C# in

    CPLEX_Studio1210\opl\examples\opl_interfaces\dotnet\x64_windows_msvc14\CSharp

    regards

    https://www.linkedin.com/pulse/low-barrier-entry-optimization-through-cplex-alex-fleischer/

    ------------------------------
    ALEX FLEISCHER
    ------------------------------



  • 3.  RE: How can I run an "existed" cplex program from c# code?

    Posted Tue July 07, 2020 06:21 AM
    Expaning on Alex's answer: the most interesting example in your case probably is OplRunSample.cs.

    In case you don't want to run an OPL model but a model that exists as an LP, MPS, or SAV file, take a look at  CPLEX_Studio1210\cplex}examples\src\dotnet

    ------------------------------
    Daniel Junglas
    ------------------------------