B  @`ƒã@s:dZdgZddlZddlmZmZmZGdd„deƒZdS)zx Utilities to support the definition of optimization applications that can be optimized with the Acro COLIN optimizers. Ú AmplModeléN)Ú ProblemFormatÚconvert_problemÚ guess_formatc@s4eZdZdZd dd„Zdd„Zdd„Zd d d „ZdS) rz: A class that provides a wrapper for AMPL models. NcCs||_||_dS)z" The constructor. N)ÚmodfileÚdatfile)Úselfrr©r ú:/tmp/pip-unpacked-wheel-bi3529v6/pyomo/opt/problem/ampl.pyÚ__init__szAmplModel.__init__cCstjgS)zSThis method allows the pyomo.opt convert function to work with an AmplModel object.)rÚmod)rr r r Úvalid_problem_types$szAmplModel.valid_problem_typescCs"|jdkr|jgS|j|jgSdS)N)rr)rr r r Ú_problem_files(s zAmplModel._problem_filescCsx|dkr|dk rt|ƒ}|dkr(dd„}|jdkr<|jf}n |j|jf}t|||g|ƒ}|dk rtt |dd|¡dS)zˆ Write the model to a file, with a given format. NOTE: this is the same exact code as is used in PyomoModel.py NcSsdS)NTr )Úxr r r Ú:óz!AmplModel.write..r)rrrrÚosÚrename)rÚfilenameÚformatZsolver_capabilityÚargsÚresr r r Úwrite.s   zAmplModel.write)N)NN)Ú__name__Ú __module__Ú __qualname__Ú__doc__r r rrr r r r rs  ) rÚ__all__rZpyomo.opt.baserrrÚobjectrr r r r Ús