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.

◆ Use the MIP optimizer if the problem contains discrete components (binary, integer, orsemi-continuous variables, piecewise linear objective, or SOS sets).In <strong>ILOG</strong> <strong>CPLEX</strong>, there are many possible parameter settings for each optimizer. Generally,the default parameter settings are best for linear programming and quadratic programmingproblems, but Solving LPs: Simplex Optimizers on page 171 and Solving Problems with aQuadratic Objective (QP) on page 227 offer more detail about improving performance withrespect to these problems. Integer programming problems are more sensitive to specificparameter settings, so you may need to experiment with them, as suggested in Solving MixedInteger Programming Problems (MIP) on page 255.In either case, the Interactive Optimizer in <strong>ILOG</strong> <strong>CPLEX</strong> lets you try different parametersettings and different optimizers to decide the best optimization procedure for yourparticular application. From what you learn by experimenting with commands in theInteractive Optimizer, you can more readily choose which method or routine from theComponent Libraries to call in your application.Program with a View toward Maintenance and ModificationsGood programming practices save development time and make an application easier tounderstand and modify. Tips for Successful Application Development on page 133 outlines<strong>ILOG</strong> programming conventions in developing <strong>ILOG</strong> <strong>CPLEX</strong>. In addition, the followingprogramming practices are recommended.Comment Your CodeComments, written in mixed upper- and lower-case, will prove useful to you at a later datewhen you stare at code written months ago and try to figure out what it does. They will alsoprove useful to <strong>ILOG</strong> staff, should you need to send <strong>ILOG</strong> your application for customersupport.Write Readable CodeFollow conventional formatting practices so that your code will be easier to read, both foryou and for others. Use fewer than 80 characters per line. Put each statement on a separateline. Use white space (for example, space, blank lines, tabs) to distinguish logical blocks ofcode. Display compound loops with clearly indented bodies. Display if statements likecombs; that is, align if and else in the same column and then indent the correspondingblock. Likewise, it is a good idea to indent the body of compound statements, loops, andother structures distinctly from their corresponding headers and closing brackets. Useuniform indentation (for example, three to five spaces). Put at least one space before andafter each relational operator, as well as before and after each binary plus (+) and minus (-).Use space as you do in normal a natural language, such as English.136 <strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL

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

Saved successfully!

Ooh no, something went wrong!