12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Step 18Enclose the application in try catch statementsGo to the comment Step 18 in Dietlesson.cs, and add the following lines to enclose yourapplication in a try and catch statement in case of anomalies during execution.}}catch (<strong>ILOG</strong>.CONCERT.Exception ex) {System.Console.WriteLine("Concert Error: " + ex);}catch (InputDataReader.InputDataReaderException ex) {System.Console.WriteLine("Data Error: " + ex);}catch (System.IO.IOException ex) {System.Console.WriteLine("IO Error: " + ex);}The try part of that try and catch statement is already available in your original copy ofDietlesson.cs. When you finish the steps of this tutorial, you will have a completeapplication ready to compile and execute.Example: Optimizing the Diet Problem in C#.NETYou can see the complete program online at:your<strong>CPLEX</strong>home\examples\src\Diet.csThere is a project for this example, suitable for use in an integrated developmentenvironment, such as Microsoft Visual Studio, at:your<strong>CPLEX</strong>home\examples\x86_.net2003_7.1\format\Diet.csprojThe empty lesson, suitable for interactively following this tutorial, is available at:your<strong>CPLEX</strong>home\examples\tutorials\Dietlesson.cs<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!