Changeset 3570


Ignore:
Timestamp:
Feb 4, 2011 4:43:03 PM (9 years ago)
Author:
khunter
Message:

Update example with a necessary import.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/doc/pyomo/pyomo-overview.tex

    r1808 r3570  
    9898Once a model instance has been constructed, an optimizer can be applied to it to find an optimal solution.  For example, the PICO integer programming solver can be used within Pyomo as follows:
    9999\begin{lstlisting}
    100 opt = solvers.SolverFactory("pico")
    101 opt.keepFiles=True
     100from coopr.opt.base import SolverFactory
     101opt = SolverFactory("pico")
     102opt.keepFiles = True
    102103results = opt.solve(instance)
    103104\end{lstlisting}
    104 This creates an optimizer object for the PICO executable, and it indicates that temporary files should be kept.  The Pyomo model instance is optimized, and the optimizer returns an object that contains the solutions generated during optimization.
     105This creates an optimizer object for the PICO executable, and it indicates that
     106temporary files should be kept.  The Pyomo model instance is optimized, and the
     107optimizer returns an object that contains the solutions generated during
     108optimization.  (Pyomo outputs a list of available solvers when run from the
     109command line with no arguments.)
    105110
    106111
Note: See TracChangeset for help on using the changeset viewer.