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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# OSSolverAgent Class Reference

Used by a client to invoke a remote solver. More...

`#include <OSSolverAgent.h>`

Inheritance diagram for OSSolverAgent:

[legend]
Collaboration diagram for OSSolverAgent:

[legend]
List of all members.

## Public Member Functions
| OSSolverAgent (string solverURI)
| Default constructor.
| ~OSSolverAgent ()
| Class destructor.
string | solve (string osil, string osol)
| implement the solve() method which is a virtual function in OShL, this is synchronous
string | getJobID (string osol)
| implement the getJobID() method which is a virtual function in OShL
bool | send (string osil, string osol)
| implement the send() method which is a virtual function in OShL
string | kill (string osol)
| implement the kill() method which is a virtual function in OShL
string | retrieve (string osol)
| implement the retrieve() method which is a virtual function in OShL
string | knock (string ospl, string osol)
| implement the knock() method which is a virtual function in OShL
string | fileUpload (string osilFileName, string osil)
| implement the fileUpload() method which is a virtual function in OShL
## Private Attributes
string | solverAddress
| solverAddress is the URI for the solver
unsigned short | solverPortNumber
| solverPortNumber is the port number for the sovler
string | postURI
| postURI is the path to the solver that follows the first / in the solverAddress

## Detailed Description

Used by a client to invoke a remote solver.

Remarks:

This is an implementation of the virtual class OShL. We need to implement the following virtual methods.

The following key methods are invoked:

1. solve
2. kill
3. send
4. retrieve
5. knock
6. getJobID

Definition at line 43 of file OSSolverAgent.h.

## Constructor & Destructor Documentation

OSSolverAgent::OSSolverAgent | ( | string | solverURI | ) |

Default constructor.

Parameters:

  | solverURI | is the location of remote solver or scheduler

Definition at line 41 of file OSSolverAgent.cpp.

References postURI, solverAddress, and solverPortNumber.

OSSolverAgent::~OSSolverAgent | ( |  | ) |

Class destructor.

Definition at line 63 of file OSSolverAgent.cpp.

## Member Function Documentation

string OSSolverAgent::solve | ( | string | osil,
|  | string | osol |
| ) |  |  |

implement the solve() method which is a virtual function in OShL, this is synchronous

Parameters:

  | osil | a string that holds the problem instance
  | osol | is a string of options for the solver

Returns:
  osrl which is a string with the result.

Definition at line 66 of file OSSolverAgent.cpp.

References WSUtil::createSOAPMessage(), WSUtil::deSOAPify(), WSUtil::getOSxL(), postURI, WSUtil::sendSOAPMessage(), WSUtil::SOAPify(), solverAddress, and solverPortNumber.

Referenced by main(), solve(), and OSMatlab::solve().

string OSSolverAgent::getJobID | ( | string | osol | ) |

implement the getJobID() method which is a virtual function in OShL

Parameters:

  | osol | is the string with the options in OSoL format

Returns:
  a string which is the jobID

Definition at line 153 of file OSSolverAgent.cpp.

References WSUtil::createSOAPMessage(), WSUtil::deSOAPify(), WSUtil::getOSxL(), postURI, WSUtil::sendSOAPMessage(), WSUtil::SOAPify(), solverAddress, and solverPortNumber.

Referenced by getJobID(), main(), and send().

bool OSSolverAgent::send | ( | string | osil,
|  | string | osol |
| ) |  |  |

implement the send() method which is a virtual function in OShL

Parameters:

  | osil | is the string with the instance in OSiL format
  | osol | is the string with the options in OSoL format

Returns:
  a bool which is true if the job is successfuly submitted

Definition at line 125 of file OSSolverAgent.cpp.

References WSUtil::createSOAPMessage(), WSUtil::deSOAPify(), WSUtil::getOSxL(), postURI, WSUtil::sendSOAPMessage(), WSUtil::SOAPify(), solverAddress, and solverPortNumber.

Referenced by main(), and send().

string OSSolverAgent::kill | ( | string | osol | ) |

implement the kill() method which is a virtual function in OShL

Parameters:

  | osol | is the string with the options in OSoL format

Returns:
  a string which is in OSpL format

Definition at line 208 of file OSSolverAgent.cpp.

References WSUtil::createSOAPMessage(), WSUtil::deSOAPify(), WSUtil::getOSxL(), postURI, WSUtil::sendSOAPMessage(), WSUtil::SOAPify(), solverAddress, and solverPortNumber.

Referenced by kill(), and main().

string OSSolverAgent::retrieve | ( | string | osol | ) |

implement the retrieve() method which is a virtual function in OShL

Parameters:

  | osol | is the string with the options in OSoL format

Returns:
  a string which is in the result of the optimization is OSrL fomrat

Definition at line 181 of file OSSolverAgent.cpp.

References WSUtil::createSOAPMessage(), WSUtil::deSOAPify(), WSUtil::getOSxL(), postURI, WSUtil::sendSOAPMessage(), WSUtil::SOAPify(), solverAddress, and solverPortNumber.

Referenced by main(), and retrieve().

string OSSolverAgent::knock | ( | string | ospl,
|  | string | osol |
| ) |  |  |

implement the knock() method which is a virtual function in OShL

Parameters:

  | ospl | is the string with the process information in OSpL format
  | osol | is the string with the options in OSoL format

Returns:
  a string which is the knock result in OSpL format.

Definition at line 235 of file OSSolverAgent.cpp.

References WSUtil::createSOAPMessage(), WSUtil::deSOAPify(), WSUtil::getOSxL(), postURI, WSUtil::sendSOAPMessage(), WSUtil::SOAPify(), solverAddress, and solverPortNumber.

Referenced by knock(), and main().

string OSSolverAgent::fileUpload | ( | string | osilFileName,
|  | string | osil |
| ) |  |  |

implement the fileUpload() method which is a virtual function in OShL

Parameters:

  | osilFileName | is the name of the file with the OSiL instance to be written on the server
  | osil | is a string with the OSiL problem instance

Definition at line 111 of file OSSolverAgent.cpp.

References WSUtil::createFormDataUpload(), postURI, WSUtil::sendSOAPMessage(), solverAddress, and solverPortNumber.

Referenced by main().

## Member Data Documentation

string OSSolverAgent::solverAddress`[private]`

solverAddress is the URI for the solver

Definition at line 134 of file OSSolverAgent.h.

Referenced by fileUpload(), getJobID(), kill(), knock(), OSSolverAgent(), retrieve(), send(), and solve().

unsigned short OSSolverAgent::solverPortNumber`[private]`

solverPortNumber is the port number for the sovler

Definition at line 137 of file OSSolverAgent.h.

Referenced by fileUpload(), getJobID(), kill(), knock(), OSSolverAgent(), retrieve(), send(), and solve().

string OSSolverAgent::postURI`[private]`

postURI is the path to the solver that follows the first / in the solverAddress

Definition at line 142 of file OSSolverAgent.h.

Referenced by fileUpload(), getJobID(), kill(), knock(), OSSolverAgent(), retrieve(), send(), and solve().

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

- /home/coin/SVN-release/OS-2.3.5/OS/src/OSAgent/OSSolverAgent.h
- /home/coin/SVN-release/OS-2.3.5/OS/src/OSAgent/OSSolverAgent.cpp