|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.optimizationservices.oscommon.representationparser.OSgLWriter
org.optimizationservices.oscommon.representationparser.OSrLWriter
public class OSrLWriter
The OSrLWriter
class is used to construct an instance that follows
the OSrL format.
Field Summary |
---|
Fields inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter |
---|
m_document |
Constructor Summary | |
---|---|
OSrLWriter()
constructor. |
Method Summary | |
---|---|
boolean |
addOtherResult(java.lang.String name,
java.lang.String value,
java.lang.String description)
Add an otherResult element. |
static void |
main(java.lang.String[] argv)
main for test purposes. |
boolean |
setAvailableDiskSpace(double availableDiskSpace)
Set the available disk space. |
boolean |
setAvailableMemory(double availableMemory)
Set the available memory (in bytes). |
boolean |
setConstraintNumber(int constraintNumber)
Set the constraint number. |
boolean |
setCurrentJobCount(int currentJobCount)
Set the current job count. |
boolean |
setCurrentState(java.lang.String currentState)
Set the current state. |
boolean |
setDualVariableValues(int solIdx,
double[] values)
Set the [i]th optimization solution's dual variable values, where i equals the given solution index. |
boolean |
setGeneralMessage(java.lang.String message)
Set the general message. |
boolean |
setGeneralStatus(GeneralStatus status)
Set the general status |
boolean |
setGeneralStatusDescription(java.lang.String description)
Set the general status description. |
boolean |
setGeneralStatusType(java.lang.String type)
Set the general status type, which can be: success, error, warning. |
boolean |
setInstanceName(java.lang.String instanceName)
Set instance name. |
boolean |
setJobID(java.lang.String jobID)
Set job id. |
boolean |
setJobStatistics(JobStatistics[] jobStatistics)
Set the statistics of all jobs. |
boolean |
setObjectiveNumber(int objectiveNumber)
Set the objective number. |
boolean |
setObjectiveValues(int solIdx,
double[] objectiveValues)
Set the [i]th optimization solution's objective values, where i equals the given solution index. |
boolean |
setOSAnalysis(OSAnalysis osAnalysis)
Set the optimization analysis. |
boolean |
setOSResult(OSResult osResult)
set the OSResult, a standard os result interface. |
boolean |
setOtherConstraintResults(int solIdx,
OtherConstraintResult[] otherConstraintResults)
Set the [i]th optimization solution's other (non-standard/solver specific)constraint-related results, where i equals the given solution index. |
boolean |
setOtherObjectiveResults(int solIdx,
OtherObjectiveResult[] otherObjectiveResults)
Set the [i]th optimization solution's other (non-standard/solver specific)objective-related results, where i equals the given solution index. |
boolean |
setOtherOptimizationResults(int solIdx,
OtherOptimizationResult[] otherOptimizationResults)
Set the [i]th optimization solution's other (non-standard/solver specific)optimization-related results, where i equals the given solution index. |
boolean |
setOtherResults(java.lang.String[] names,
java.lang.String[] values,
java.lang.String[] descriptions)
Set all the otherResult related elements. |
boolean |
setOtherVariableResults(int solIdx,
OtherVariableResult[] otherVariableResults)
Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index. |
boolean |
setPrimalVariableStringValues(int solIdx,
java.lang.String[] x)
Set the [i]th optimization solution's primal variable string values, where i equals the given solution index. |
boolean |
setPrimalVariableValues(int solIdx,
double[] x)
Set the [i]th optimization solution's primal variable values, where i equals the given solution index. |
boolean |
setProcessStatistics(ProcessStatistics processStatistics)
Set the process statistics. |
boolean |
setResultTime(java.util.GregorianCalendar time)
Set time of the result. |
boolean |
setServiceName(java.lang.String serviceName)
Set service name. |
boolean |
setServiceURI(java.lang.String serviceURI)
Set service uri. |
boolean |
setServiceUtilization(double serviceUtilization)
Set the service utilization. |
boolean |
setSolution(int solIdx,
OptimizationSolution solution)
Set the [i]th optimization solution, where i equals the given solution index. |
boolean |
setSolutionMessage(int solIdx,
java.lang.String solutionMessage)
Set the [i]th optimization solution message, where i equals the given solution index. |
boolean |
setSolutionNumber(int solutionNumber)
set the number of solutions. |
boolean |
setSolutionObjectiveIndex(int solIdx,
int objectiveIdx)
Set the [i]th optimization solution's objective index, where i equals the given solution index. |
boolean |
setSolutionStatus(int solIdx,
OptimizationSolutionStatus status)
Set the [i]th optimization solution status, where i equals the given solution index. |
boolean |
setSolutionStatus(int solIdx,
java.lang.String type,
java.lang.String description,
OptimizationSolutionSubstatus[] subStatuses)
Set the [i]th optimization solution status, where i equals the given solution index. |
boolean |
setTimeLastJobEnded(java.util.GregorianCalendar timeLastJobEnded)
Set the time last job ended. |
boolean |
setTimeLastJobTook(double timeLastJobTook)
Set the time last job took. |
boolean |
setTimeServiceStarted(java.util.GregorianCalendar timeServiceStarted)
Set the time the service started. |
boolean |
setTotalJobsSoFar(int totalJobsSoFar)
Set the total jobs received so far. |
boolean |
setVariableNumber(int variableNumber)
Set the variable number. |
Methods inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter |
---|
getDocument, setDocument, writeToFile, writeToSring, writeToStandardOutput |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OSrLWriter()
Method Detail |
---|
public boolean setOSResult(OSResult osResult) throws java.lang.Exception
osResult
- holds the standard os result interface.
java.lang.Exception
public boolean setGeneralStatus(GeneralStatus status)
status
- holds the general status.
public boolean setGeneralStatusType(java.lang.String type)
type
- holds the general status type
public boolean setGeneralStatusDescription(java.lang.String description)
description
- holds the general status description.
public boolean setServiceURI(java.lang.String serviceURI)
serviceURI
- holds the uri of the service.
public boolean setServiceName(java.lang.String serviceName)
serviceName
- holds the name of the service.
public boolean setInstanceName(java.lang.String instanceName)
instanceName
- holds the name of the instance.
public boolean setJobID(java.lang.String jobID)
jobID
- holds the job id.
public boolean setResultTime(java.util.GregorianCalendar time)
time
- holds the time of the result.
public boolean setGeneralMessage(java.lang.String message)
message
- holds the general message.
public boolean setProcessStatistics(ProcessStatistics processStatistics)
processStatistics
- holds the process statistics.
public boolean setCurrentState(java.lang.String currentState)
currentState
- holds the current state, which can be:
"busy", "busyButAccepting", "idle", "idleButNotAccepting" or "noResponse".
public boolean setAvailableDiskSpace(double availableDiskSpace)
availableDiskSpace
- holds the available disk space (in bytes).
public boolean setAvailableMemory(double availableMemory)
availableMemory
- holds the available memory.
public boolean setCurrentJobCount(int currentJobCount)
currentJobCount
- holds the current job count.
public boolean setTotalJobsSoFar(int totalJobsSoFar)
totalJobsSoFar
- holds the total jobs received so far.
public boolean setTimeLastJobEnded(java.util.GregorianCalendar timeLastJobEnded)
timeLastJobEnded
- holds the time last job ended.
public boolean setTimeLastJobTook(double timeLastJobTook)
timeLastJobTook
- holds the time last job took (in seconds).
public boolean setTimeServiceStarted(java.util.GregorianCalendar timeServiceStarted)
timeServiceStarted
- holds the time the service started.
public boolean setServiceUtilization(double serviceUtilization)
serviceUtilization
- holds the service utilization ([0, 1]).
public boolean setJobStatistics(JobStatistics[] jobStatistics)
jobStatistics
- holds an array of jobStatistics with
each member corresponding to one job.
public boolean setOtherResults(java.lang.String[] names, java.lang.String[] values, java.lang.String[] descriptions)
names
- holds the names of all the other result information. It is required.values
- holds the values of all the other result information, empty String "" if no value for one otherResult element.descriptions
- holds the descriptions of all the other result information, empty String "" if no value for one otherResult, null for
the entire array if none of the otherResult elements have descriptions.
public boolean addOtherResult(java.lang.String name, java.lang.String value, java.lang.String description)
name
- holds the name of the otherResult element. It is required.value
- holds the value of the otherResult element, empty String "" if none.description
- holds the description of the otherResult element, empty String "" if none.
public boolean setVariableNumber(int variableNumber)
variableNumber
- holds the number of variables
public boolean setObjectiveNumber(int objectiveNumber)
objectiveNumber
- holds the number of objectives
public boolean setConstraintNumber(int constraintNumber)
constraintNumber
- holds the number of constraints
public boolean setSolutionNumber(int solutionNumber)
solutionNumber
- holds the number of solutions to set.
setVariableNumber(int)
,
setObjectiveNumber(int)
,
setConstraintNumber(int)
public boolean setSolution(int solIdx, OptimizationSolution solution)
solIdx
- holds the solution index to set the solution.solution
- holds the optimization solution to set.
OptimizationSolution
,
setSolutionNumber(int)
public boolean setSolutionStatus(int solIdx, OptimizationSolutionStatus status)
solIdx
- holds the solution index to set the solution status.status
- holds the optimization solution status to set.
OptimizationSolutionStatus
,
setSolutionNumber(int)
public boolean setSolutionStatus(int solIdx, java.lang.String type, java.lang.String description, OptimizationSolutionSubstatus[] subStatuses)
solIdx
- holds the solution index to set the solution status.type
- holds the optimization solution status type to set; it is required.
The solution status type can be:
unbounded, globallyOptimal, locallyOptimal, optimal, bestSoFar, feasible, infeasible,
stoppedByLimit, unsure, error, otherdescription
- holds the optimization solution status description to set, null or empty string if none.subStatus
- holds an array of optimization solution subStatuses to set, null if none.
OptimizationSolutionStatus
,
org.optimizationservices.oscommon.datastructure.osresult.OptimizationSolutionSubStatus
,
setSolutionNumber(int)
public boolean setSolutionMessage(int solIdx, java.lang.String solutionMessage)
solIdx
- holds the solution index to set the solution message.solutionMessage
- holds the solution message to set.
setSolutionNumber(int)
public boolean setSolutionObjectiveIndex(int solIdx, int objectiveIdx)
solIdx
- holds the solution index to set the objective index.objectiveIdx
- holds the objective index to set.
All the objective indexes are negative starting from -1 downward.
setSolutionNumber(int)
public boolean setPrimalVariableValues(int solIdx, double[] x)
solIdx
- holds the solution index to set the primal variable values.x
- holds a double dense array of variable values to set; it could be null if all variables are 0.
setSolutionNumber(int)
public boolean setPrimalVariableStringValues(int solIdx, java.lang.String[] x)
solIdx
- holds the solution index to set the primal variable string values.x
- holds a dense string array of variable string values to set.
setSolutionNumber(int)
public boolean setOtherVariableResults(int solIdx, OtherVariableResult[] otherVariableResults)
otherVariableResults
- holds an array of other variable results in OtherVariableResult[] array data structure, null if none.
Each other variable result contains the name (required), an optional description (string) and an optional
value (string). Each other variable result can also optionally contain an array OtherVarResult for each variable.
The OtherVarResult contains a variable idx (required), and an optional string value.
OtherVariableResult
,
OtherVarResult
,
setSolutionNumber(int)
public boolean setObjectiveValues(int solIdx, double[] objectiveValues)
solIdx
- holds the solution index to set the objective values.objectiveValues
- holds a double dense array of objective values to set.
Possibly only the objective that the solution is based on has the value, and the rest of the objective
values all get a Double.NaN value, meaning that they are not calculated.
setSolutionNumber(int)
public boolean setOtherObjectiveResults(int solIdx, OtherObjectiveResult[] otherObjectiveResults)
solIdx
- holds the solution index to set the other objective results.otherObjectiveResults
- holds an array of other objective results in OtherObjectiveResult[] array data structure, null if none.
Each other objective result contains the name (required), an optional description (string) and an optional
value (string). Each other objective result can also optionally contain an array OtherObjResult for each objective.
The OtherObjResult contains an objective idx (required), an optional string value.
OtherObjectiveResult
,
OtherObjResult
,
setSolutionNumber(int)
public boolean setDualVariableValues(int solIdx, double[] values)
solIdx
- holds the solution index to set the dual variable values.values
- holds a double dense array of variable dual values to set; it could be null if all values are 0.
setSolutionNumber(int)
public boolean setOtherConstraintResults(int solIdx, OtherConstraintResult[] otherConstraintResults)
otherConstraintResults
- holds an array of other constraint results in OtherConstraintResult[] array data structure, null if none.
Each other constraint result contains the name (required), an optional description (string) and an optional
value (string). Each other constraint result can also optionally contain an array OtherConstraint for each constraint.
The OtherConResult contains a constraint idx (required), and an optional string value.
OtherConstraintResult
,
OtherConResult
,
setSolutionNumber(int)
public boolean setOtherOptimizationResults(int solIdx, OtherOptimizationResult[] otherOptimizationResults)
otherOptimizationResults
- holds an array of other optimization results in OtherOptimizationResult[] array data structure, null if none.
Each other optimization result contains the name (required), an optional description (string) and an optional
value (string).
OtherOptimizationResult
,
setSolutionNumber(int)
public boolean setOSAnalysis(OSAnalysis osAnalysis)
osAnalysis
- holds the optimization analysis in the standard OSAnalysis data structure.
OSAnalysis
,
setSolutionNumber(int)
public static void main(java.lang.String[] argv)
argv
- command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |