#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>
Go to the source code of this file.
Defines | |
| #define | MAXCHARS 5000 |
Typedefs | |
| typedef struct yy_buffer_state * | YY_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) |
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 MAXCHARS 5000 |
Definition at line 122 of file OSAmplClient.cpp.
| typedef struct yy_buffer_state* YY_BUFFER_STATE |
Definition at line 124 of file OSAmplClient.cpp.
| YY_BUFFER_STATE osss_scan_string | ( | const char * | osss, | |
| void * | scanner | |||
| ) |
| void setyyextra | ( | osOptionsStruc * | osoptions, | |
| void * | scanner | |||
| ) |
Definition at line 3154 of file OSParseosss.cpp.
| int ossslex | ( | void * | scanner | ) |
| int ossslex_init | ( | void ** | ptr | ) |
Definition at line 2982 of file OSParseosss.cpp.
| int ossslex_destroy | ( | void * | scanner | ) |
Definition at line 3073 of file OSParseosss.cpp.
| void getAmplClientOptions | ( | char * | options, | |
| std::string * | solverName, | |||
| std::string * | optionFile, | |||
| std::string * | serviceLocation | |||
| ) |
Definition at line 398 of file OSAmplClient.cpp.
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 145 of file OSAmplClient.cpp.
1.6.1