My Project
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 "OSOutput.h"
#include "OSConfig.h"
#include "OSDefaultSolver.h"
#include "OSWSUtil.h"
#include "OSSolverAgent.h"
#include "OShL.h"
#include "OSErrorClass.h"
#include "OSmps2OS.h"
#include "OSBase64.h"
#include "OSRunSolver.h"
#include "OSCommandLine.h"
#include <stdio.h>
#include <map>

Go to the source code of this file.

Macros

#define MAXCHARS   5000
 

Typedefs

typedef struct yy_buffer_stateYY_BUFFER_STATE
 

Functions

YY_BUFFER_STATE osss_scan_string (const char *osss, void *scanner)
 
void setyyextra (OSCommandLine *oscommandline, void *scanner)
 
int ossslex (void *scanner)
 
int ossslex_init (void **ptr)
 
int ossslex_destroy (void *scanner)
 
void interactiveShell ()
 
std::string get_help ()
 
std::string get_version ()
 
std::string get_options ()
 
std::string get_solverlist ()
 
void list_options (OSCommandLine *oscommandline)
 
void merge_CL_options (OSCommandLine *oscommandline)
 This routine merges command line options destined for the remote system with any options already found in an osol file.
 
void solve (OSCommandLine *oscommandline)
 Next we have implementations of the six service methods solve, send, retrieve, knock, kill, getJobID.
 
void getJobID (OSCommandLine *oscommandline)
 
void send (OSCommandLine *oscommandline)
 
void knock (OSCommandLine *oscommandline)
 
void retrieve (OSCommandLine *oscommandline)
 
void kill (OSCommandLine *oscommandline)
 
void getOS (OSCommandLine *oscommandline)
 Some wrappers around routines that allow getting problem instances in other formats: .nl (from AMPL), GAMS, MPS format.
 
void getOSFromNl (OSCommandLine *oscommandline)
 
void getOSFromMps (OSCommandLine *oscommandline)
 
void getOSFromGams (OSCommandLine *oscommandline)
 
void doPrintModel (OSCommandLine *oscommandline)
 
void doPrintModel (OSInstance *osinstance)
 
void doPrintRow (OSCommandLine *oscommandline)
 
void doPrintRow (OSInstance *osinstance, std::string rownumberstring)
 
int main (int argC, const char *argV[])
 
void getServiceLocation (OSCommandLine *oscommandline)
 ======================== Interactive shell =========================
 

Variables

const OSSmartPtr< OSOutputosoutput
 

Detailed Description

Author
Horand Gassmann, Jun Ma, Kipp Martin
Remarks
Copyright (C) 2005-2014, Horand Gassmann, Jun Ma, Kipp Martin, 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 it remains NULL, a problem instance must be specified in the osol file)
  • -osol xxx.osol (file name on local machine of solver options, 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 is 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)
Author
Horand Gassmann, Jun Ma, Kipp Martin
Remarks
Copyright (C) 2005-2012, Horand Gassmann, Jun Ma, Kipp Martin, 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 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 is 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.

Macro Definition Documentation

◆ MAXCHARS

#define MAXCHARS   5000

Definition at line 140 of file OSSolverService.cpp.

Typedef Documentation

◆ YY_BUFFER_STATE

Definition at line 142 of file OSSolverService.cpp.

Function Documentation

◆ osss_scan_string()

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

◆ setyyextra()

void setyyextra ( OSCommandLine * oscommandline,
void * scanner )

Definition at line 3383 of file OSParseosss.cpp.

◆ ossslex()

int ossslex ( void * scanner)

◆ ossslex_init()

int ossslex_init ( void ** ptr)

Definition at line 3211 of file OSParseosss.cpp.

◆ ossslex_destroy()

int ossslex_destroy ( void * scanner)

Definition at line 3302 of file OSParseosss.cpp.

◆ interactiveShell()

void interactiveShell ( )

Definition at line 1537 of file OSSolverService.cpp.

◆ get_help()

std::string get_help ( )

Definition at line 2080 of file OSSolverService.cpp.

◆ get_version()

std::string get_version ( )

Definition at line 2273 of file OSSolverService.cpp.

◆ get_options()

std::string get_options ( )

Definition at line 2284 of file OSSolverService.cpp.

◆ get_solverlist()

std::string get_solverlist ( )

Definition at line 2425 of file OSSolverService.cpp.

◆ list_options()

void list_options ( OSCommandLine * oscommandline)

Definition at line 2537 of file OSSolverService.cpp.

◆ merge_CL_options()

void merge_CL_options ( OSCommandLine * oscommandline)

This routine merges command line options destined for the remote system with any options already found in an osol file.

In case of conflicting info, the command line takes precedent

Definition at line 1332 of file OSSolverService.cpp.

◆ solve()

void solve ( OSCommandLine * oscommandline)

Next we have implementations of the six service methods solve, send, retrieve, knock, kill, getJobID.

Definition at line 684 of file OSSolverService.cpp.

◆ getJobID()

void getJobID ( OSCommandLine * oscommandline)

Definition at line 926 of file OSSolverService.cpp.

◆ send()

void send ( OSCommandLine * oscommandline)

Definition at line 1079 of file OSSolverService.cpp.

◆ knock()

void knock ( OSCommandLine * oscommandline)

Definition at line 991 of file OSSolverService.cpp.

◆ retrieve()

void retrieve ( OSCommandLine * oscommandline)

Definition at line 1161 of file OSSolverService.cpp.

◆ kill()

void kill ( OSCommandLine * oscommandline)

Definition at line 1250 of file OSSolverService.cpp.

◆ getOS()

void getOS ( OSCommandLine * oscommandline)

Some wrappers around routines that allow getting problem instances in other formats: .nl (from AMPL), GAMS, MPS format.

Definition at line 1405 of file OSSolverService.cpp.

◆ getOSFromNl()

void getOSFromNl ( OSCommandLine * oscommandline)

Definition at line 1431 of file OSSolverService.cpp.

◆ getOSFromMps()

void getOSFromMps ( OSCommandLine * oscommandline)

Definition at line 1494 of file OSSolverService.cpp.

◆ getOSFromGams()

void getOSFromGams ( OSCommandLine * oscommandline)

Definition at line 1464 of file OSSolverService.cpp.

◆ doPrintModel() [1/2]

void doPrintModel ( OSCommandLine * oscommandline)

Definition at line 2590 of file OSSolverService.cpp.

◆ doPrintModel() [2/2]

void doPrintModel ( OSInstance * osinstance)

Definition at line 2635 of file OSSolverService.cpp.

◆ doPrintRow() [1/2]

void doPrintRow ( OSCommandLine * oscommandline)

Definition at line 2648 of file OSSolverService.cpp.

◆ doPrintRow() [2/2]

void doPrintRow ( OSInstance * osinstance,
std::string rownumberstring )

Definition at line 2709 of file OSSolverService.cpp.

◆ main()

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

Parse the command line

Deal with action items: -printLevel, -logFile, -filePrintLevel, –help, –version

Definition at line 179 of file OSSolverService.cpp.

◆ getServiceLocation()

void getServiceLocation ( OSCommandLine * oscommandline)
inline

======================== Interactive shell =========================

Definition at line 1526 of file OSSolverService.cpp.

Variable Documentation

◆ osoutput

const OSSmartPtr<OSOutput> osoutput
extern

Definition at line 39 of file OSOutput.cpp.