/home/coin/SVN-release/OS-2.4.1/OS/applications/amplClient/OSAmplClient.cpp File Reference

#include "OSCoinSolver.h"
#include "OSConfig.h"
#include "OSnl2osil.h"
#include "OSiLReader.h"
#include "OSrLReader.h"
#include "OSiLWriter.h"
#include "OSrLWriter.h"
#include "OSInstance.h"
#include "OSResult.h"
#include "OSOption.h"
#include "OSoLReader.h"
#include "OSoLWriter.h"
#include "OSFileUtil.h"
#include "OSDefaultSolver.h"
#include "OSSolverAgent.h"
#include "OShL.h"
#include "OSErrorClass.h"
#include "CoinError.hpp"
#include "OSOptionsStruc.h"
#include "OSRunSolver.h"
#include <sstream>
#include "CoinHelperFunctions.hpp"
#include <iostream>
#include <asl.h>

Include dependency graph for OSAmplClient.cpp:

Go to the source code of this file.

Defines

#define MAXCHARS   5000

Typedefs

typedef yy_buffer_stateYY_BUFFER_STATE

Functions

YY_BUFFER_STATE osss_scan_string (const char *osss, void *scanner)
void setyyextra (osOptionsStruc *osoptions, void *scanner)
int ossslex (void *scanner)
int ossslex_init (void **ptr)
int ossslex_destroy (void *scanner)
void getAmplClientOptions (char *options, std::string *solverName, std::string *optionFile, std::string *serviceLocation)
int main (int argc, char **argv)


Detailed Description

Author:
Robert Fourer, Horand Gassmann, Jun Ma, Kipp Martin
Remarks:
Copyright (C) 2005-2011, Robert Fourer, Horand Gassmann, Jun Ma, Kipp Martin, Northwestern University, Dalhousie University and the University of Chicago. All Rights Reserved. This software is licensed under the Eclipse Public License. Please see the accompanying LICENSE file in OS root directory for terms.
This executable is designed to act as a "solver" for AMPL. It can be used to solve problems locally or on a remote server. For example, to solve a problem locally, start AMPL. We assume that the model is hs71.mod. Execute the following sequence of commands:

model hs71.mod;
option solver OSAmplClient;
option OSAmplClient_options "-solver bonmin";
write gtestfile;
solve;
display x1;
you should get:

x1 = 1

display x2;
you should get:

x2 = 4.743

in general, specify options to the OSAmplclient solver by using the AMPL command OSAmplClient_options as another example, if you wanted to solve hs71.mod on a remote server you would do: model hs71.mod;
option solver OSAmplClient;
option OSAmplClient_options "-serviceLocation http://gsbkip.chicagogsb.edu/os/OSSolverService.jws";

there are three possible options to specify:

{itemize}

the name of the solver using the { -solver} option, valid values for this option are { clp}, { cbc}, { dylp}, { ipopt}, { bonmin}, { couenne}, { symphony}, and { vol}.

the location of the remote server using the { -serviceLocation} option

the location of the option file using the { -osol} option

{itemize}

if no options are specified using { OSAmplClient}, by default,for continuous linear models clp is used. For continuous nonlinear models ipopt is used. For mixed-integer linear models (MIP), cbc is used. For mixed-integer nonlinear models bonmin is used. All solvers are invoked locally. See the Users Manual in the doc folder for more information

Definition in file OSAmplClient.cpp.


Define Documentation

#define MAXCHARS   5000

Definition at line 122 of file OSAmplClient.cpp.

Referenced by main().


Typedef Documentation

typedef struct yy_buffer_state* YY_BUFFER_STATE

Definition at line 124 of file OSAmplClient.cpp.


Function Documentation

YY_BUFFER_STATE osss_scan_string ( const char *  osss,
void *  scanner 
)

Referenced by getAmplClientOptions(), interactiveShell(), and main().

void setyyextra ( osOptionsStruc osoptions,
void *  scanner 
)

Definition at line 3154 of file OSParseosss.cpp.

References osoptions, and osssset_extra().

Referenced by getAmplClientOptions(), interactiveShell(), and main().

int ossslex ( void *  scanner  ) 

Referenced by getAmplClientOptions(), interactiveShell(), and main().

int ossslex_init ( void **  ptr  ) 

Definition at line 2982 of file OSParseosss.cpp.

References osssalloc(), and yy_init_globals().

Referenced by getAmplClientOptions(), interactiveShell(), and main().

int ossslex_destroy ( void *  scanner  ) 

Definition at line 3073 of file OSParseosss.cpp.

References osss_delete_buffer(), osssfree(), ossspop_buffer_state(), yyguts_t::yy_buffer_stack, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_globals(), and yyguts_t::yy_start_stack.

Referenced by getAmplClientOptions(), and main().

void getAmplClientOptions ( char *  options,
std::string *  solverName,
std::string *  optionFile,
std::string *  serviceLocation 
)

Definition at line 398 of file OSAmplClient.cpp.

References osOptionsStruc::browser, osOptionsStruc::configFile, ErrorClass::errormsg, osOptionsStruc::gamsControlFile, osOptionsStruc::insList, osOptionsStruc::invokeHelp, osOptionsStruc::mpsFile, osOptionsStruc::nlFile, osOptionsStruc::osil, osOptionsStruc::osilFile, osOptionsStruc::osol, osOptionsStruc::osolFile, osoptions, osOptionsStruc::osplInputFile, osOptionsStruc::osplOutputFile, osOptionsStruc::osrl, osOptionsStruc::osrlFile, osss_scan_string(), ossslex(), ossslex_destroy(), ossslex_init(), scanner, osOptionsStruc::serviceLocation, osOptionsStruc::serviceMethod, setyyextra(), osOptionsStruc::solverName, and osOptionsStruc::writeVersion.

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 145 of file OSAmplClient.cpp.

References OSnl2osil::createOSInstance(), ErrorClass::errormsg, getAmplClientOptions(), OSResult::getConstraintNumber(), FileUtil::getFileAsString(), OSResult::getOptimalDualVariableValues(), OSResult::getOptimalPrimalVariableValues(), OSResult::getVariableNumber(), k, OSiLWriter::m_bWhiteSpace, OSnl2osil::osinstance, osinstance, osresult, OSrLReader::readOSrL(), runSolver(), OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSSolverAgent::solve(), FileUtil::writeFileFromString(), OSiLWriter::writeOSiL(), OSrLWriter::writeOSrL(), and x.


Generated on Thu Nov 10 03:10:43 2011 by  doxygen 1.4.7