Title: | XML-RPC Interface to NEOS |
---|---|
Description: | Within this package the XML-RPC API to NEOS <https://neos-server.org/neos/> is implemented. This enables the user to pass optimization problems to NEOS and retrieve results within R. |
Authors: | Bernhard Pfaff [aut, cre], Duncan Temple Lang [ctb] (included XMLRPC package, hosted at http://www.omegahat.net/XMLRPC/; BSD license.) |
Maintainer: | Bernhard Pfaff <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.4-0 |
Built: | 2024-11-24 02:53:07 UTC |
Source: | https://github.com/cran/rneos |
This function creates an object of class NeosComm
that will
contain all necessary information for dealing with HTTP requests to
NEOS. This object will be needed in all requests to NEOS and hence
must be created in advance of XML-RPC requests.
CreateNeosComm(curlopts = list(httpheader = c(`Content-Type` = "text/xml", `User-Agent` = "R"), port = 3333), curlhandle = getCurlHandle())
CreateNeosComm(curlopts = list(httpheader = c(`Content-Type` = "text/xml", `User-Agent` = "R"), port = 3333), curlhandle = getCurlHandle())
curlopts |
A named list of elements that are passed as options to
curl. By default, the |
curlhandle |
An object of class |
A list of valid curl
options can be retrieved from
listCurlOptions()
. Please note, that the relevant HTTP-bodies
within the requests will be created directly in the API-functions
provided in this package and must not be provided as list elements in
curloptions
. However, if one accesses NEOS via a
Proxy-Server, for instance, than the values for the relevant options
must be set within the list-argument curlopts
.
The values of the returned object will be passed down to the function
xml.rpc()
which is utilised for all calls to the function
Nfoo
contained in this package. Hereby, foo
signify the
name of NEOS-API.
An object of class NeosComm
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: nc <- CreateNeosComm() nc ## End(Not run)
## Not run: nc <- CreateNeosComm() nc ## End(Not run)
With this function the information for XML-templates can be
inserted. Ordinarily, one creates an object with the function
NgetSolverTemplate()
first and then inserts the
requested CDATA fields of this XML-form with this function.
CreateXmlString(neosxml, cdatalist)
CreateXmlString(neosxml, cdatalist)
neosxml |
An object of class |
cdatalist |
A named list object with the CDATA tags to be filled. |
A character string containing the specified optimization
problem, which can then be used in a call to NsubmitJob()
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosXml
and NgetSolverTemplate
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") cat(modc) datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") cat(datc) ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) xmls ## End(Not run)
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") cat(modc) datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") cat(datc) ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) xmls ## End(Not run)
This functions calls the XML-RPC method “emailHelp()” of NEOS and returns general help message for email users.
NemailHelp(convert = TRUE, nc = CreateNeosComm())
NemailHelp(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: NemailHelp() ## End(Not run)
## Not run: NemailHelp() ## End(Not run)
Objects of this class contain the returned results from NEOS as well as information on which kind of query has been sent and how it was sent.
Objects can be created by calls of the form new("NeosAns", ...)
or more conveniently by calling the relevant R API functions.
ans
:Object of class "character"
: The returned
XML-RPC of NEOS as character string.
method
:Object of class "character"
: The name
of the called API function.
call
:Object of class "call"
: The call to the
generating function of the object.
nc
:Object of class "NeosComm"
: The NeosComm
object that has been used in the request to NEOS.
signature(object = "NeosAns")
: Returns the
converted slot ans
from an object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
showClass("NeosAns")
showClass("NeosAns")
The purpose of this class is to gather the relevant information needed for HTTP requests that is passed to NEOS.
Objects can be created by calls of the form new("NeosComm", ...)
or more conveniently by creating an object from CreateNeosComm()
.
url
:Object of class "character"
:
The URL to NEOS, i.e., http://www.neos-server.org
curlopts
:Object of class "list"
:
A named list of valid Curl options.
curlhandle
:Object of class "CURLHandle"
:
Objects of this class can be created and altered with
getCurlHandle()
No methods defined with class "NeosComm" in the signature.
Bernhard Pfaff
Omegahat web site for RCurl: http://www.omegahat.net/RCurl, and
libcurl web site: http://curl.haxx.se
CreateNeosComm
, getCurlHandle
and
CURLHandle-class
showClass("NeosComm") ## Not run: nc <- CreateNeosComm() nc ## End(Not run)
showClass("NeosComm") ## Not run: nc <- CreateNeosComm() nc ## End(Not run)
Objects of this class contain among other slots the returned jobnumber and password for jobs submitted to NEOS. Objects of this class can then be used for retrieving the optimization results.
Objects can be created by calls of the form new("NeosJob", ...)
or more conveniently by calling the relevant R API function
NsubmitJob
.
jobnumber
:Object of class "numeric"
:
The returned job number.
password
:Object of class "character"
:
The returned pass word.
method
:Object of class "character"
:
The name of the called API function.
call
:Object of class "call"
:
The call to the generating function of the object.
nc
:Object of class "NeosComm"
:
The NeosComm object that has been used in the request to NEOS.
signature(object = "NeosJob")
: Displays the slots
jobnumber
and password
from an object of class
NeosJob
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
showClass("NeosJob") ## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) ## End(Not run)
showClass("NeosJob") ## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) ## End(Not run)
Objects of this class contain among other slots the partial result and the offset.
Objects can be created by calls of the form new("NeosOff", ...)
.
ans
:Object of class "character"
: The partial
result returned from NEOS.
offset
:Object of class "integer"
: The integer
offset until the results have been returned.
jobnumber
:Object of class "numeric"
: The
returned job number.
password
:Object of class "character"
: The
returned pass word.
method
:Object of class "character"
: The name
of the called API function.
call
:Object of class "call"
: The call to the
generating function of the object.
nc
:Object of class "NeosComm"
: The NeosComm
object that has been used in the request to NEOS.
Updates an object of class NeosOff
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
showClass("NeosOff")
showClass("NeosOff")
Objects of this class contain the returned results from NEOS as well as information on which kind of query has been sent and how it was sent.
Objects can be created by calls of the form new("NeosXml", ...)
or more conveniently by calling the relevant R API functions.
xml
:Object of class "XMLNode"
:
The returned and converted XML-template of NEOS.
method
:Object of class "character"
:
The name of the called API function.
call
:Object of class "call"
:
The call to the generating function of the object.
nc
:Object of class "NeosComm"
:
The NeosComm object that has been used in the request to NEOS.
signature(object = "NeosXml")
: Returns the
converted slot xml
from an object of class NeosXml
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
showClass("NeosXml") ## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetJobStatus(obj = test, convert = TRUE) NgetJobInfo(obj = test, convert = TRUE) NgetFinalResults(obj = test, convert = TRUE) ## End(Not run)
showClass("NeosXml") ## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetJobStatus(obj = test, convert = TRUE) NgetJobInfo(obj = test, convert = TRUE) NgetFinalResults(obj = test, convert = TRUE) ## End(Not run)
This functions calls the XML-RPC method “getFinalResults()” of NEOS, which gets results of a job submitted to NEOS. If the job is still running, then this function will hang until the job is finished.
NgetFinalResults(obj, convert = TRUE)
NgetFinalResults(obj, convert = TRUE)
obj |
NeosJob, an object of class |
convert |
Logical, if |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosAns
and NsubmitJob
## Not run: tmp <-NgetSolverTemplate(category = "lp", solvername = "MOSEK", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetFinalResults(obj = test, convert = TRUE) ## End(Not run)
## Not run: tmp <-NgetSolverTemplate(category = "lp", solvername = "MOSEK", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetFinalResults(obj = test, convert = TRUE) ## End(Not run)
This functions calls the XML-RPC method “getFinalResultsNonBlocking()” of NEOS, which gets results of a job submitted to NEOS. If the job is still running, then this function will return an empty string (base-64 encoded).
NgetFinalResultsNonBlocking(obj, convert = TRUE)
NgetFinalResultsNonBlocking(obj, convert = TRUE)
obj |
NeosJob, an object of class |
convert |
Logical, if |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosAns
and NsubmitJob
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetFinalResultsNonBlocking(obj = test, convert = TRUE) ## End(Not run)
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetFinalResultsNonBlocking(obj = test, convert = TRUE) ## End(Not run)
This functions calls the XML-RPC method “getIntermediateResults()” of NEOS, which returns intermediate results of a job submitted to NEOS, starting at the character offset up to the last received data. Intermediate results are usually the standard output of the solver daemon. If the job is still running, then this function will hang until another packet of output is sent to NEOS or the job is finished. This function will return a tuple of thebase-64 encoded object and the new offset (object, newoffset). The offset refers to uncoded characters.
NgetIntermediateResults(obj, offset = NULL, convert = TRUE)
NgetIntermediateResults(obj, offset = NULL, convert = TRUE)
obj |
NeosJob, an object of class |
offset |
Integer, the offset from which on the results are
returned. In a first run this is set to |
convert |
Logical, if |
An object of class NeosOff
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosOff
and NsubmitJob
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetIntermediateResults(obj = test, convert = TRUE) ## End(Not run)
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetIntermediateResults(obj = test, convert = TRUE) ## End(Not run)
This functions calls the XML-RPC method “getIntermediateResultsNonBlocking()” of NEOS, which returns intermediate results of a job submitted to NEOS, starting at the character offset up to the last received data. Intermediate results are usually the standard output of the solver daemon. If the job is still running, then this function will hang until another packet of output is sent to NEOS or the job is finished. This function will return a tuple of thebase-64 encoded object and the new offset (object, newoffset). The offset refers to uncoded characters.
NgetIntermediateResultsNonBlocking(obj, offset = NULL, convert = TRUE)
NgetIntermediateResultsNonBlocking(obj, offset = NULL, convert = TRUE)
obj |
NeosJob, an object of class |
offset |
Integer, the offset from which on the results are
returned. In a first run this is set to |
convert |
Logical, if |
An object of class NeosOff
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosOff
and NsubmitJob
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetIntermediateResultsNonBlocking(obj = test, convert = TRUE) ## End(Not run)
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetIntermediateResultsNonBlocking(obj = test, convert = TRUE) ## End(Not run)
This functions calls the XML-RPC method “getJobInfo()” of NEOS and returns a four-tuple (category, solver name, input, status).
NgetJobInfo(obj, convert = TRUE)
NgetJobInfo(obj, convert = TRUE)
obj |
Object of class |
convert |
Logical, if |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosAns
, NeosJob
and NgetJobStatus
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetJobInfo(obj = test, convert = TRUE) ## End(Not run)
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetJobInfo(obj = test, convert = TRUE) ## End(Not run)
This functions calls the XML-RPC method “getJobStatus()” of
NEOS and returns an object of class NeosAns
. The functions
returns the current job status (either “Done”, “Running”,
“Waiting”, “Unknown Job” or “Bad Password”).
NgetJobStatus(obj, convert = TRUE)
NgetJobStatus(obj, convert = TRUE)
obj |
NeosJob, an object of class |
convert |
Logical, if |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosAns
and NsubmitJob
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetJobStatus(obj = test, convert = TRUE) ## End(Not run)
## Not run: tmp <-NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## setting path to example model and data file modf <- system.file("ExAMPL", "diet.mod", package = "rneos") datf <- system.file("ExAMPL", "diet.dat", package = "rneos") ## import of file contents modc <- paste(paste(readLines(modf), collapse = "\n"), "\n") datc <- paste(paste(readLines(datf), collapse = "\n"), "\n") ## create list object argslist <- list(model = modc, data = datc, commands = "", comments = "") ## create XML string xmls <- CreateXmlString(neosxml = tmp, cdatalist = argslist) test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "", id = 0) NgetJobStatus(obj = test, convert = TRUE) ## End(Not run)
This functions calls the XML-RPC method “getSolverTemplate()”
of NEOS. If the solver category:solvername:inputMethod exists on NEOS,
then an XML template is returned as an object of class NeosXml
.
NgetSolverTemplate(category, solvername, inputMethod, nc = CreateNeosComm())
NgetSolverTemplate(category, solvername, inputMethod, nc = CreateNeosComm())
category |
Character, the abbreviation of a category |
solvername |
Character, the name of the solver to be used. |
inputMethod |
Character, the name of the solver for which the xml-template shall be returned. |
nc |
Object of class |
An object of class NeosXml
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosXml
, NlistAllSolvers
and
CreateNeosComm
## Not run: NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## End(Not run)
## Not run: NgetSolverTemplate(category = "go", solvername = "ASA", inputMethod = "AMPL") ## End(Not run)
This functions calls the XML-RPC method “help()” of NEOS and
returns an object of class NeosAns
.
Nhelp(convert = TRUE, nc = CreateNeosComm())
Nhelp(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: Nhelp() ## End(Not run)
## Not run: Nhelp() ## End(Not run)
This method is used to cancel a job submission running on NEOS (or
waiting to run on NEOS). The job password is required to prevent abuse
of this function (extracted from relevant slot of obj
). This
functions calls the XML-RPC method “killJob()” of NEOS and
returns an object of class NeosAns
.
NkillJob(obj, killmsg = NULL, convert = TRUE)
NkillJob(obj, killmsg = NULL, convert = TRUE)
obj |
Object of class |
killmsg |
Character, optional description. |
convert |
Logical, if |
An object of class NeosAns
containing the returned message from
NEOS.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
This functions calls the XML-RPC method “listAllSolvers()” of
NEOS and returns an object of class NeosAns
; a list of
category:solver:inputMethod
.
NlistAllSolvers(convert = TRUE, nc = CreateNeosComm())
NlistAllSolvers(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: NlistAllSolvers() ## End(Not run)
## Not run: NlistAllSolvers() ## End(Not run)
This functions calls the XML-RPC method “listCategories()” of
NEOS and returns an object of class NeosAns
; a dictionary with
entries ('abbreviated name':'full name',...).
NlistCategories(convert = TRUE, nc = CreateNeosComm())
NlistCategories(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: NlistCategories() ## End(Not run)
## Not run: NlistCategories() ## End(Not run)
This functions calls the XML-RPC method
“listSolversInCategory()” of NEOS and returns an object of
class NeosAns
. The returned content is a list of solver:input
for every solver in the category (category can be abbreviation or
full\_name).
NlistSolversInCategory(category, convert = TRUE, nc = CreateNeosComm())
NlistSolversInCategory(category, convert = TRUE, nc = CreateNeosComm())
category |
Character, the abbreviation of a category |
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosAns
, NlistCategories
and
CreateNeosComm
## Not run: NlistSolversInCategory(category = "go") ## End(Not run)
## Not run: NlistSolversInCategory(category = "go") ## End(Not run)
This functions calls the XML-RPC method “ping()” of NEOS and
returns an object of class NeosAns
. It is verified that this
NeosServer is running and a message ‘NeosServer is alive’ is
returned.
Nping(convert = TRUE, nc = CreateNeosComm())
Nping(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosAns
, NlistCategories
and
CreateNeosComm
## Not run: Nping() ## End(Not run)
## Not run: Nping() ## End(Not run)
This functions calls the XML-RPC method “printQueue()” of NEOS
and returns an object of class NeosAns
, which is a string
containing the current NEOS jobs.
NprintQueue(convert = TRUE, nc = CreateNeosComm())
NprintQueue(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: NprintQueue() ## End(Not run)
## Not run: NprintQueue() ## End(Not run)
This functions calls the XML-RPC method “submitJob()” of NEOS and
returns an object of class NeosJob
.
NsubmitJob(xmlstring, user = "rneos", interface = "", id = 0, nc = CreateNeosComm())
NsubmitJob(xmlstring, user = "rneos", interface = "", id = 0, nc = CreateNeosComm())
xmlstring |
Character, the xml string according to the solver's template and filled withe the user's optimisation data. |
user |
Character, the name of the user; for certain optimizers an email address is required. |
interface |
Character, the name of the interface. |
id |
Integer, an identifier for the submitted job. |
nc |
Object of class |
An object of class NeosJob
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
NeosJob
, CreateXmlString
and
NgetSolverTemplate
This functions calls the XML-RPC method “version()” of NEOS and
returns an object of class NeosAns
, which is a string
containing the version number of the NEOS server.
Nversion(convert = TRUE, nc = CreateNeosComm())
Nversion(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: Nversion() ## End(Not run)
## Not run: Nversion() ## End(Not run)
This functions calls the XML-RPC method “welcome()” of NEOS and
returns an object of class NeosAns
, which is a welcome message
(string).
Nwelcome(convert = TRUE, nc = CreateNeosComm())
Nwelcome(convert = TRUE, nc = CreateNeosComm())
convert |
Logical, if |
nc |
Object of class |
An object of class NeosAns
.
Bernhard Pfaff
NEOS API: https://neos-server.org/neos/xml-rpc.html
## Not run: Nwelcome() ## End(Not run)
## Not run: Nwelcome() ## End(Not run)
This function and its methods convert R objects to XML for use in XML-RPC requests.
rpc.serialize(x, ...)
rpc.serialize(x, ...)
x |
the R object to be serialized in XML-RPC format |
... |
additional parameters understood by methods |
An XMLInternalNode
object representing the XML content.
Duncan Temple Lang
The XML-RPC specification at http://www.xmlrpc.com/spec.md.
This function can be used to invoke a method provided by an XML-RPC (remote procedure call) server. It can pass R objects in the request by serializing them to XML format and also converts the result back to R.
xml.rpc(url, method, ..., .args = list(...), .opts = list(), .defaultOpts = list(httpheader = c("Content-Type" = "text/xml"), followlocation = TRUE, useragent = useragent), .convert = TRUE, .curl = getCurlHandle(), useragent = "R-XMLRPC")
xml.rpc(url, method, ..., .args = list(...), .opts = list(), .defaultOpts = list(httpheader = c("Content-Type" = "text/xml"), followlocation = TRUE, useragent = useragent), .convert = TRUE, .curl = getCurlHandle(), useragent = "R-XMLRPC")
url |
the URL of the XML-RPC server |
method |
a string giving the name of the XML-RPC method to invoke |
... |
a collection of argument valuesn |
.args |
an alternative way to specify the collection (list) of arguments |
.opts |
a list of options passed on to
|
.defaultOpts |
standard/default RCurl options used when making this call |
.convert |
either a logical value indicating whether to perform
the defalt conversion (via |
.curl |
a CURLHandle object that the caller can specify to allow reusing existing handles and connections. This can greatly improve efficiency. |
useragent |
the string identifying the application that is reported to the Web server as making the request. |
If .convert
is a logical value and TRUE
, an R object
giving the result of the XML-RPC method invocation. If .convert
is FALSE
, a string giving the body of the response.
If .convert
is a function, it is called with the body of the
XML-RPC response as a string.
Duncan Temple Lang
http://www.xmlrpc.com http://www.cafeconleche.org/books/xmljava/chapters/ch02s05.html for a DTD for XML-RPC and examples and discussion.
postForm
getURL
and REST Web services
SSOAP
package.
The XMLRPCServer
class is a means to
identify a string as the URL of an XML-RPC server.
We can then use this to invoke a method provided
by the server either via a call to xml.rpc
or via an expression of the form
server$methodName(arg1, arg2, ...)
.
The XMLRPCServerConnection
class allows us to
associate a CURLHandle
object with an XML-RPC
server. This connection is then used in each of the
calls to that server. This allows us to reuse a single
curl connection to the server and also slightly simplifies
passing it to each call.
XMLRPCServer(url, curl = NULL, class = if (!is.null(curl)) "XMLRPCServerConnection" else "XMLRPCServer", ..., .opts = list(...))
XMLRPCServer(url, curl = NULL, class = if (!is.null(curl)) "XMLRPCServerConnection" else "XMLRPCServer", ..., .opts = list(...))
url |
the URL for the XML-RPC server. |
curl |
either a logical value indicating whether to create
a new |
class |
the name of the class to create. |
... |
name=value pairs of CURL options that are used to create a
new |
.opts |
an alternative way to specify the CURL options for the handle to be created. |
An object of class given by the value of class
.
Duncan Temple Lang