XML-RPC method getIntermediateResults of Neos

Share:

Description

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.

Usage

1

Arguments

obj

NeosJob, an object of class NeosJob as returned by the function NsubmitJob.

offset

Integer, the offset from which on the results are returned. In a first run this is set to integer(0).

convert

Logical, if convert = TRUE (the default) the value of the returned XML-RPC result is extracted and returned as character, otherwise the XML-RPC string is returned (base-64 encoded).

Value

An object of class NeosOff.

Author(s)

Bernhard Pfaff

References

NEOS API: http://neos-guide.org/content/NEOS-API,
Omegahat web site for RCurl: http://www.omegahat.net/RCurl,
Omegahat web site for XMLRPC: http://www.omegahat.net/XMLRPC

See Also

NeosOff and NsubmitJob

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## 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 = template, cdatalist = argslist)
test <- NsubmitJob(xmlstring = xmls, user = "rneos", interface = "",
id = 0)
NgetIntermediateResults(obj = test, convert = TRUE)

## End(Not run)