- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# /home/coin/SVN-release/OS-2.3.5/OS/src/OSSolverService.cpp File Reference

`#include "OSCoinSolver.h"`
`#include "OSResult.h"`
`#include "OSiLReader.h"`
`#include "OSiLWriter.h"`
`#include "OSoLReader.h"`
`#include "OSrLReader.h"`
`#include "OSrLWriter.h"`
`#include "OSInstance.h"`
`#include "OSOption.h"`
`#include "OSoLWriter.h"`
`#include "OSFileUtil.h"`
`#include "OSConfig.h"`
`#include "OSDefaultSolver.h"`
`#include "OSWSUtil.h"`
`#include "OSSolverAgent.h"`
`#include "OShL.h"`
`#include "OSErrorClass.h"`
`#include "OSmps2osil.h"`
`#include "OSBase64.h"`
`#include "OSOptionsStruc.h"`
`#include <stdio.h>`
`#include <map>`

Include dependency graph for OSSolverService.cpp:

Go to the source code of this file.

## Defines
#define | MAXCHARS 5000
## Typedefs
typedef 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)
std::string | get_help ()
std::string | get_version ()
std::string | get_options ()
void | reset_options ()
void | solve ()
void | getJobID ()
void | send ()
void | kill ()
void | retrieve ()
void | knock ()
void | getOSiLFromNl ()
void | getOSiLFromMps ()
void | getOSiLFromGams ()
std::string | buildSolver (std::string solverName, std::string osol, OSInstance *osinstance)
void | listOptions (osOptionsStruc *osoptions)
int | main (int argC, const char *argV[])
## Variables
osOptionsStruc * | osoptions

## Detailed Description

Author:
  Horand Gassmann, Jun Ma, Kipp Martin,

Remarks:
  Copyright (C) 2005-2011, Horand Gassmann, Jun Ma, Kipp Martin, Dalhousie University, Northwestern 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 root directory for terms.

INPUTS:

- -osil xxx.osil (file name on local machine of optimization instance, this is NULL by default, however if this remains NULL a problem instance must be specified in the osol file)
- -osol xxx.osol (file name on local machine of solver options, default default value is NULL)
- -osrl xxx.osrl (file name on local machine where the optimization result is put, default is NULL)
- -serviceLocation location URL (the URL of the server that is called remotely if the problem not solved locally, default is NULL)
- -serviceMethod (send, solve, kill, knock, getJobID, retrieve, default value is solve)
- -os (Not used for now -- ignore)
- -osplInput xxx.ospl name of file with input in OS Process Language
- -osplOutput xxx.ospl name of output file in OS Process Language
- -mps xxxx.mps (converts mps format to osil and has same effect as -osil)
- -nl xxxx.nl (converts nl format to osil and has same effect as -osil)
- -solver solverName (the name of the solver to be invoked)
- -browser path location to browser e.g. /Applications/Firefox.app/Contents/MacOS/firefox (default is NULL)
- -config pathToConfigFile is the path to a configure file with the problem parameters
- -insList xxx.dat (used only for LINDO, file location on local machine of LINDO instruction list)

Definition in file OSSolverService.cpp.

## Define Documentation

#define MAXCHARS 5000

Definition at line 141 of file OSSolverService.cpp.

## Typedef Documentation

typedef struct yy_buffer_state* YY_BUFFER_STATE

Definition at line 143 of file OSSolverService.cpp.

## Function Documentation

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 | ) |

std::string get_help | ( |  | ) |

Definition at line 1694 of file OSSolverService.cpp.

std::string get_version | ( |  | ) |

Definition at line 1887 of file OSSolverService.cpp.

std::string get_options | ( |  | ) |

Definition at line 2126 of file OSSolverService.cpp.

Referenced by main().

void reset_options | ( |  | ) |

Definition at line 2092 of file OSSolverService.cpp.

References osOptionsStruc::browser, osOptionsStruc::configFile, osOptionsStruc::exit, osOptionsStruc::gamsControlFile, osOptionsStruc::insList, osOptionsStruc::invokeHelp, osOptionsStruc::jobID, osOptionsStruc::mps, osOptionsStruc::mpsFile, osOptionsStruc::nl, osOptionsStruc::nlFile, osOptionsStruc::osil, osOptionsStruc::osilFile, osOptionsStruc::osol, osOptionsStruc::osolFile, osoptions, osOptionsStruc::osplInput, osOptionsStruc::osplInputFile, osOptionsStruc::osplOutput, osOptionsStruc::osplOutputFile, osOptionsStruc::osrl, osOptionsStruc::osrlFile, osOptionsStruc::quit, osOptionsStruc::serviceLocation, osOptionsStruc::serviceMethod, osOptionsStruc::solverName, and osOptionsStruc::writeVersion.

Referenced by main().

void solve | ( |  | ) |

Definition at line 943 of file OSSolverService.cpp.

References osOptionsStruc::browser, buildSolver(), OSgams2osil::createOSInstance(), OSmps2osil::createOSInstance(), OSnl2osil::createOSInstance(), ErrorClass::errormsg, osOptionsStruc::gamsControlFile, getOSiLFromGams(), getOSiLFromMps(), getOSiLFromNl(), osOptionsStruc::mpsFile, osOptionsStruc::nlFile, OS_SCHEMA_VERSION, osOptionsStruc::osil, OSgams2osil::osinstance, OSmps2osil::osinstance, OSnl2osil::osinstance, osOptionsStruc::osol, osoptions, osresult, osOptionsStruc::osrlFile, OSiLReader::readOSiL(), osOptionsStruc::serviceLocation, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSSolverAgent::solve(), osOptionsStruc::solverName, FileUtil::writeFileFromString(), and OSrLWriter::writeOSrL().

Referenced by main().

void getJobID | ( |  | ) |

Definition at line 1144 of file OSSolverService.cpp.

References ErrorClass::errormsg, OSSolverAgent::getJobID(), osOptionsStruc::jobID, osOptionsStruc::osol, osoptions, osresult, osOptionsStruc::serviceLocation, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), and OSrLWriter::writeOSrL().

Referenced by main().

void send | ( |  | ) |

Definition at line 1269 of file OSSolverService.cpp.

References ErrorClass::errormsg, OSSolverAgent::getJobID(), getOSiLFromMps(), getOSiLFromNl(), osOptionsStruc::jobID, osOptionsStruc::mpsFile, osOptionsStruc::nlFile, osOptionsStruc::osil, osOptionsStruc::osol, osoptions, osresult, osOptionsStruc::osrlFile, OSSolverAgent::send(), osOptionsStruc::serviceLocation, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSOption::setJobID(), FileUtil::writeFileFromString(), OSoLWriter::writeOSoL(), and OSrLWriter::writeOSrL().

Referenced by main().

void kill | ( |  | ) |

Definition at line 1434 of file OSSolverService.cpp.

References ErrorClass::errormsg, osOptionsStruc::jobID, OSSolverAgent::kill(), osOptionsStruc::osol, osoptions, osOptionsStruc::osplOutputFile, osresult, osOptionsStruc::serviceLocation, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSOption::setJobID(), FileUtil::writeFileFromString(), OSoLWriter::writeOSoL(), and OSrLWriter::writeOSrL().

Referenced by main().

void retrieve | ( |  | ) |

Definition at line 1352 of file OSSolverService.cpp.

References osOptionsStruc::browser, ErrorClass::errormsg, osOptionsStruc::jobID, osOptionsStruc::osol, osoptions, osresult, osOptionsStruc::osrlFile, OSSolverAgent::retrieve(), osOptionsStruc::serviceLocation, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSOption::setJobID(), FileUtil::writeFileFromString(), OSoLWriter::writeOSoL(), and OSrLWriter::writeOSrL().

Referenced by main().

void knock | ( |  | ) |

Definition at line 1197 of file OSSolverService.cpp.

References ErrorClass::errormsg, osOptionsStruc::jobID, OSSolverAgent::knock(), osOptionsStruc::osol, osoptions, osOptionsStruc::osplInput, osOptionsStruc::osplOutputFile, osresult, osOptionsStruc::serviceLocation, OSResult::setGeneralMessage(), OSResult::setGeneralStatusType(), OSOption::setJobID(), FileUtil::writeFileFromString(), OSoLWriter::writeOSoL(), and OSrLWriter::writeOSrL().

Referenced by main().

void getOSiLFromNl | ( |  | ) |

Definition at line 1511 of file OSSolverService.cpp.

References OSnl2osil::createOSInstance(), ErrorClass::errormsg, osOptionsStruc::nlFile, osOptionsStruc::osil, OSnl2osil::osinstance, osoptions, and OSiLWriter::writeOSiL().

Referenced by send(), and solve().

void getOSiLFromMps | ( |  | ) |

Definition at line 1563 of file OSSolverService.cpp.

References OSmps2osil::createOSInstance(), ErrorClass::errormsg, osOptionsStruc::mpsFile, osOptionsStruc::osil, OSmps2osil::osinstance, osoptions, and OSiLWriter::writeOSiL().

Referenced by send(), and solve().

void getOSiLFromGams | ( |  | ) |

Definition at line 1537 of file OSSolverService.cpp.

References OSgams2osil::createOSInstance(), ErrorClass::errormsg, osOptionsStruc::gamsControlFile, osOptionsStruc::osil, OSgams2osil::osinstance, osoptions, and OSiLWriter::writeOSiL().

Referenced by solve().

std::string buildSolver | ( | std::string | solverName,
|  | std::string | osol,
|  | OSInstance * | osinstance |
| ) |  |  |

Definition at line 1899 of file OSSolverService.cpp.

References DefaultSolver::buildSolverInstance(), OSInstance::getNumberOfBinaryVariables(), OSInstance::getNumberOfIntegerVariables(), OSInstance::getNumberOfNonlinearExpressions(), OSInstance::getNumberOfQuadraticTerms(), DefaultSolver::osinstance, osinstance, DefaultSolver::osol, DefaultSolver::osrl, DefaultSolver::setSolverOptions(), DefaultSolver::solve(), and DefaultSolver::sSolverName.

Referenced by solve().

void listOptions | ( | osOptionsStruc * | osoptions | ) |

Definition at line 2234 of file OSSolverService.cpp.

References osOptionsStruc::configFile, osOptionsStruc::jobID, osOptionsStruc::mpsFile, osOptionsStruc::nlFile, osOptionsStruc::osilFile, osOptionsStruc::osolFile, osoptions, osOptionsStruc::osplInputFile, osOptionsStruc::osrlFile, osOptionsStruc::serviceLocation, osOptionsStruc::serviceMethod, and osOptionsStruc::solverName.

Referenced by main().

int main | ( | int | argC,
|  | const char * | argV[] |
| ) |  |  |

Definition at line 183 of file OSSolverService.cpp.

References osOptionsStruc::configFile, osOptionsStruc::dat, osOptionsStruc::datFile, ErrorClass::errormsg, osOptionsStruc::exit, get_options(), FileUtil::getFileAsString(), getJobID(), getVersionInfo(), osOptionsStruc::jobID, kill(), knock(), listOptions(), MAXCHARS, osOptionsStruc::mps, osOptionsStruc::mpsFile, osOptionsStruc::nl, osOptionsStruc::nlFile, osOptionsStruc::osil, osOptionsStruc::osilFile, osOptionsStruc::osol, osOptionsStruc::osolFile, osoptions, osOptionsStruc::osplInput, osOptionsStruc::osplInputFile, osOptionsStruc::osrlFile, osss_scan_string(), ossslex(), ossslex_destroy(), ossslex_init(), osOptionsStruc::quit, reset_options(), retrieve(), scanner, send(), osOptionsStruc::serviceLocation, setyyextra(), solve(), and osOptionsStruc::solverName.

## Variable Documentation

osOptionsStruc* osoptions

Definition at line 181 of file OSSolverService.cpp.

Referenced by getAmplClientOptions(), getJobID(), getOSiLFromGams(), getOSiLFromMps(), getOSiLFromNl(), kill(), knock(), listOptions(), main(), reset_options(), retrieve(), send(), setyyextra(), and solve().