My Project
OSCommandLine Class Reference

This class is used to store command line options for the OSSolverService executable and to provide methods to manipulate them. More...

#include <OSCommandLine.h>

Public Member Functions

 OSCommandLine ()
 constructor method
 
 ~OSCommandLine ()
 destructor method
 
void reset_options ()
 a function to reset the command line to default values useful especially in the interactive shell
 
std::string list_options ()
 a function to print the current command line option values
 
void convertSolverNameToLowerCase ()
 to avoid ambiguity it might be necessary to convert the solver name to lower case ...
 
void convertSolverNameToUpperCase ()
 ... or to upper case
 

Public Attributes

OSInstanceosinstance
 osinstance is a representation of the instance in OSInstance format
 
OSOptionosoption
 osoption is a representation of the solver options in OSOption format
 
std::string serviceLocation
 serviceLocation is the URL of the remote solver when a local solver is not used
 
std::string serviceMethod
 the service method the OSSolverService should execute, i.e.
 
std::string solverName
 the name of the solver to be invoked locally, e.g -solver Ipopt
 
std::string configFile
 configFile is the name of the file that holds the configuration options if the OSSolverService reads its options from a file rather than command line inputs
 
std::string osilFile
 osilFile is the name of the file that holds the model instance in OSiL format
 
std::string osil
 osil is the content of the osilFile
 
std::string osilOutputFile
 osilOutputFile is the name of the file to which the instance can be written in OSiL format.
 
std::string osolFile
 osolFile is the name of the file that holds the solver options in OSoL format
 
std::string osol
 osol is the content of the osolFile
 
std::string osolOutputFile
 osolOutputFile is the name of the file to which the solver options can be written in OSoL format.
 
std::string osrlFile
 osrlFile is the name of the file where the solver should write the result (in OSrL format)
 
std::string insListFile
 name of the file containing the instance in LINDO instruction list format
 
std::string insList
 insList is the content of the insListFile – this is not implemented
 
std::string osplInputFile
 name of an input file with xml in OS process language format, used for example to knock on a server, for example -osplInput ../data/osplFiles/demo.ospl
 
std::string osplInput
 osplInput is the content of the osplInputFile
 
std::string osplOutputFile
 name of an output file where the solver should write the result of a knock or kill service request
 
std::string mpsFile
 the name of the file that holds an instance in MPS format
 
std::string mps
 the string that holds an instance in MPS format
 
std::string nlFile
 the name of the file that holds an instance in AMPL nl format
 
std::string nl
 the string that holds an instance in AMPL nl format
 
std::string datFile
 the name of the file that holds an instance in GAMS dat format
 
std::string dat
 the string that holds an instance in GAMS dat format
 
std::string gamsControlFile
 the name of the file that holds the GAMS control parameters
 
std::string browser
 this parameter is a path to the browser on the local machine.
 
int printLevel
 this parameter controls the amount of output to print the higher the number, the more output is generated details about print levels can be found in OSOutput.h
 
std::string logFile
 this optional parameter contains the path to a logfile that can be used as an alternate output stream in addition to the normal output to stdout
 
int filePrintLevel
 this parameter controls the amount of output to send to the log file (if used) the higher the number, the more output is generated details about print levels can be found in OSOutput.h
 
std::string jobID
 the JobID
 
bool invokeHelp
 if this parameter is true we print the contents of the file help.txt and return
 
bool listOptions
 if this parameter is true we echo the values of the options found on the command line
 
bool writeVersion
 if this parameter is true we print the current version of the OS project
 
bool printModel
 if this parameter is true we print the current instance as read from an osil, nl or mps file
 
std::string printRowNumberAsString
 this parameter contains a string representation (!) of the row number if only a single row (constraint or objective) of the current instance is to be printed String representations are easier to parse in OSParseosss.l and are easier to recognize as being present or absent
 
bool quit
 if this parameter is true we quit/exit
 

Detailed Description

This class is used to store command line options for the OSSolverService executable and to provide methods to manipulate them.

Author
Horand Gassmann, Jun Ma, Kipp Martin
Remarks
the OSSolverService requires numerous options and these options are stored in the OSCommandLine class

Definition at line 36 of file OSCommandLine.h.

Constructor & Destructor Documentation

◆ OSCommandLine()

OSCommandLine::OSCommandLine ( )

constructor method

Definition at line 82 of file OSCommandLine.cpp.

◆ ~OSCommandLine()

OSCommandLine::~OSCommandLine ( )

destructor method

Definition at line 92 of file OSCommandLine.cpp.

Member Function Documentation

◆ reset_options()

void OSCommandLine::reset_options ( )

a function to reset the command line to default values useful especially in the interactive shell

Definition at line 34 of file OSCommandLine.cpp.

◆ list_options()

std::string OSCommandLine::list_options ( )

a function to print the current command line option values

Definition at line 121 of file OSCommandLine.cpp.

◆ convertSolverNameToLowerCase()

void OSCommandLine::convertSolverNameToLowerCase ( )

to avoid ambiguity it might be necessary to convert the solver name to lower case ...

Definition at line 103 of file OSCommandLine.cpp.

◆ convertSolverNameToUpperCase()

void OSCommandLine::convertSolverNameToUpperCase ( )

... or to upper case

Definition at line 112 of file OSCommandLine.cpp.

Member Data Documentation

◆ osinstance

OSInstance* OSCommandLine::osinstance

osinstance is a representation of the instance in OSInstance format

Definition at line 42 of file OSCommandLine.h.

◆ osoption

OSOption* OSCommandLine::osoption

osoption is a representation of the solver options in OSOption format

Definition at line 47 of file OSCommandLine.h.

◆ serviceLocation

std::string OSCommandLine::serviceLocation

serviceLocation is the URL of the remote solver when a local solver is not used

Definition at line 52 of file OSCommandLine.h.

◆ serviceMethod

std::string OSCommandLine::serviceMethod

the service method the OSSolverService should execute, i.e.

solve, send, getJobID, kill, knock, or retrieve

Definition at line 57 of file OSCommandLine.h.

◆ solverName

std::string OSCommandLine::solverName

the name of the solver to be invoked locally, e.g -solver Ipopt

Definition at line 62 of file OSCommandLine.h.

◆ configFile

std::string OSCommandLine::configFile

configFile is the name of the file that holds the configuration options if the OSSolverService reads its options from a file rather than command line inputs

Definition at line 68 of file OSCommandLine.h.

◆ osilFile

std::string OSCommandLine::osilFile

osilFile is the name of the file that holds the model instance in OSiL format

Definition at line 73 of file OSCommandLine.h.

◆ osil

std::string OSCommandLine::osil

osil is the content of the osilFile

Definition at line 77 of file OSCommandLine.h.

◆ osilOutputFile

std::string OSCommandLine::osilOutputFile

osilOutputFile is the name of the file to which the instance can be written in OSiL format.

This is especially useful for converting the instance from other representation formats such as AMPL nl format or MPS format. If this parameter is empty, the instance will not be saved.

Definition at line 84 of file OSCommandLine.h.

◆ osolFile

std::string OSCommandLine::osolFile

osolFile is the name of the file that holds the solver options in OSoL format

Definition at line 89 of file OSCommandLine.h.

◆ osol

std::string OSCommandLine::osol

osol is the content of the osolFile

Definition at line 93 of file OSCommandLine.h.

◆ osolOutputFile

std::string OSCommandLine::osolOutputFile

osolOutputFile is the name of the file to which the solver options can be written in OSoL format.

This is especially useful when an instance represented in another representation format such as AMPL nl format or MPS format contains array-valued options such as initial values or basis information. If this parameter is empty, the solver options will not be saved.

Definition at line 101 of file OSCommandLine.h.

◆ osrlFile

std::string OSCommandLine::osrlFile

osrlFile is the name of the file where the solver should write the result (in OSrL format)

Definition at line 106 of file OSCommandLine.h.

◆ insListFile

std::string OSCommandLine::insListFile

name of the file containing the instance in LINDO instruction list format

Definition at line 111 of file OSCommandLine.h.

◆ insList

std::string OSCommandLine::insList

insList is the content of the insListFile – this is not implemented

Definition at line 115 of file OSCommandLine.h.

◆ osplInputFile

std::string OSCommandLine::osplInputFile

name of an input file with xml in OS process language format, used for example to knock on a server, for example -osplInput ../data/osplFiles/demo.ospl

Definition at line 121 of file OSCommandLine.h.

◆ osplInput

std::string OSCommandLine::osplInput

osplInput is the content of the osplInputFile

Definition at line 125 of file OSCommandLine.h.

◆ osplOutputFile

std::string OSCommandLine::osplOutputFile

name of an output file where the solver should write the result of a knock or kill service request

Definition at line 131 of file OSCommandLine.h.

◆ mpsFile

std::string OSCommandLine::mpsFile

the name of the file that holds an instance in MPS format

Definition at line 134 of file OSCommandLine.h.

◆ mps

std::string OSCommandLine::mps

the string that holds an instance in MPS format

Definition at line 137 of file OSCommandLine.h.

◆ nlFile

std::string OSCommandLine::nlFile

the name of the file that holds an instance in AMPL nl format

Definition at line 140 of file OSCommandLine.h.

◆ nl

std::string OSCommandLine::nl

the string that holds an instance in AMPL nl format

Definition at line 143 of file OSCommandLine.h.

◆ datFile

std::string OSCommandLine::datFile

the name of the file that holds an instance in GAMS dat format

Definition at line 146 of file OSCommandLine.h.

◆ dat

std::string OSCommandLine::dat

the string that holds an instance in GAMS dat format

Definition at line 149 of file OSCommandLine.h.

◆ gamsControlFile

std::string OSCommandLine::gamsControlFile

the name of the file that holds the GAMS control parameters

Definition at line 152 of file OSCommandLine.h.

◆ browser

std::string OSCommandLine::browser

this parameter is a path to the browser on the local machine.

If this optional parameter is specified then the solver result in OSrL format is transformed using XSLT into HTML and displayed in the browser, e.g. -browser /Applications/Firefox.app/Contents/MacOS/firefox

Definition at line 160 of file OSCommandLine.h.

◆ printLevel

int OSCommandLine::printLevel

this parameter controls the amount of output to print the higher the number, the more output is generated details about print levels can be found in OSOutput.h

Definition at line 166 of file OSCommandLine.h.

◆ logFile

std::string OSCommandLine::logFile

this optional parameter contains the path to a logfile that can be used as an alternate output stream in addition to the normal output to stdout

Definition at line 172 of file OSCommandLine.h.

◆ filePrintLevel

int OSCommandLine::filePrintLevel

this parameter controls the amount of output to send to the log file (if used) the higher the number, the more output is generated details about print levels can be found in OSOutput.h

Definition at line 179 of file OSCommandLine.h.

◆ jobID

std::string OSCommandLine::jobID

the JobID

Definition at line 182 of file OSCommandLine.h.

◆ invokeHelp

bool OSCommandLine::invokeHelp

if this parameter is true we print the contents of the file help.txt and return

Definition at line 187 of file OSCommandLine.h.

◆ listOptions

bool OSCommandLine::listOptions

if this parameter is true we echo the values of the options found on the command line

Definition at line 192 of file OSCommandLine.h.

◆ writeVersion

bool OSCommandLine::writeVersion

if this parameter is true we print the current version of the OS project

Definition at line 197 of file OSCommandLine.h.

◆ printModel

bool OSCommandLine::printModel

if this parameter is true we print the current instance as read from an osil, nl or mps file

Definition at line 202 of file OSCommandLine.h.

◆ printRowNumberAsString

std::string OSCommandLine::printRowNumberAsString

this parameter contains a string representation (!) of the row number if only a single row (constraint or objective) of the current instance is to be printed String representations are easier to parse in OSParseosss.l and are easier to recognize as being present or absent

Definition at line 210 of file OSCommandLine.h.

◆ quit

bool OSCommandLine::quit

if this parameter is true we quit/exit

  • only used in the interactive shell

Definition at line 215 of file OSCommandLine.h.


The documentation for this class was generated from the following files: