org.optimizationservices.oscommon.localinterface
Class OSAnalysis

java.lang.Object
  extended by org.optimizationservices.oscommon.localinterface.OSAnalysis

public class OSAnalysis
extends java.lang.Object

The OSAnalysis class is a local interface for storing Optimization Services problem analysis. Its design follows the Optimization Services analysis Language (OSaL). All the data structures in this class are standards specified in OSaL. Developers can add service-specific analyses by extending this class.

Since:
OS 1.0
Version:
1.0, 03/14/2005
Author:
Robert Fourer, Jun Ma, Kipp Martin
See Also:
OSInstance, OSResult, OSOption

Field Summary
 AnalysisData analysisData
          analysisData holds the second child of the OSAnalysis specified by the OSaL Schema.
 AnalysisHeader analysisHeader
          analysisHeader holds the first child of the OSAnalysis specified by the OSaL Schema.
 
Constructor Summary
OSAnalysis()
          Default constructor.
 
Method Summary
 java.lang.String getAnalysisMessage()
          Get analysis message.
 AnalysisStatus getAnalysisStatus()
          Get analysis status
 java.util.GregorianCalendar getAnalysisTime()
          Get analysis time.
 ConstraintAnalysis getConstraintAnalysis()
          get analysis of the constraints.
 int getConstraintNumber()
          Get constraint number.
 InstanceAnalysis getInstanceAnalysis()
          get analysis of the entire instance.
 java.lang.String getInstanceName()
          Get instance name.
 java.lang.String getJobID()
          Get job ID.
 LinearConstraintCoefficientAnalysis getLinearConstraintCoefficientAnalysis()
          get analysis of the linear constraint coefficients.
 NonlinearExpressionAnalysis getNonlinearExpressionAnalysis()
          get analysis of the entire nonlinear expressions.
 ObjectiveAnalysis getObjectiveAnalysis()
          get analysis of the objectives.
 int getObjectiveNumber()
          Get objective number.
 java.util.Hashtable<java.lang.String,java.lang.String> getOtherAnalysisDescriptions()
          get a hashmap of other analysis descriptions.
 java.lang.String[] getOtherAnalysisNames()
          get a string array of names of other analyses.
 java.util.Hashtable<java.lang.String,java.lang.String> getOtherAnalysisValues()
          get a hashmap of other analysis values.
 QuadraticCoefficientAnalysis getQuadraticCoefficientAnalysis()
          get analysis of the entire quadratic coefficients.
 java.lang.String getServiceName()
          Get service name.
 java.lang.String getServiceURI()
          Get service URI.
 VariableAnalysis getVariableAnalysis()
          get analysis of the variables
 int getVariableNumber()
          Get variable number.
static void main(java.lang.String[] args)
          main for test purposes.
 OSAnalysis readOSaL(java.lang.String osal, boolean isFile, boolean validate)
          read an OSaL instance and return and OSAnalysis object.
 boolean setAnalysisMessage(java.lang.String message)
          Set analysis message.
 boolean setAnalysisStatus(AnalysisStatus status)
          Set analysis status
 boolean setAnalysisTime(java.util.GregorianCalendar time)
          Set analysis time.
 boolean setConstraintAnalysis(ConstraintAnalysis constraintAnalysis)
          Set analysis of the constraints.
 boolean setConstraintNumber(int constraintNumber)
          Set the constraint number.
 boolean setInstanceAnalysis(InstanceAnalysis instanceAnalysis)
          Set analysis of the entire instance.
 boolean setInstanceName(java.lang.String instanceName)
          Set instance name.
 boolean setJobID(java.lang.String jobID)
          Set jobID.
 boolean setLinearConstraintCoefficientAnalysis(LinearConstraintCoefficientAnalysis linearConstraintCoefficientAnalysis)
          Set analysis of the linear constraint coefficients.
 boolean setNonlinearExpressionAnalysis(NonlinearExpressionAnalysis nonlinearExpressionAnalysis)
          Set analysis of the entire nonlinear expressions.
 boolean setObjectiveAnalysis(ObjectiveAnalysis objectiveAnalysis)
          Set analysis of the objectives.
 boolean setObjectiveNumber(int objectiveNumber)
          Set the objective number.
 boolean setOtherAnalyses(java.lang.String[] names, java.lang.String[] descriptions, java.lang.String[] values)
          set other analyses, with their names (required), descriptions (optional) and values (optional).
 boolean setQuadraticCoefficientAnalysis(QuadraticCoefficientAnalysis quadraticCoefficientAnalysis)
          Set analysis of the entire quadratic coefficients.
 boolean setServiceName(java.lang.String serviceName)
          Set service name.
 boolean setServiceURI(java.lang.String serviceURI)
          Set service URI.
 boolean setVariableAnalysis(VariableAnalysis variableAnalysis)
          Set analysis of the variables.
 boolean setVariableNumber(int variableNumber)
          Set the variable number.
 java.lang.String writeOSaL()
          write the OSAnalysis to an osal xml string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

analysisHeader

public AnalysisHeader analysisHeader
analysisHeader holds the first child of the OSAnalysis specified by the OSaL Schema.


analysisData

public AnalysisData analysisData
analysisData holds the second child of the OSAnalysis specified by the OSaL Schema.

Constructor Detail

OSAnalysis

public OSAnalysis()
Default constructor.

Method Detail

readOSaL

public OSAnalysis readOSaL(java.lang.String osal,
                           boolean isFile,
                           boolean validate)
                    throws java.lang.Exception
read an OSaL instance and return and OSAnalysis object.

Parameters:
osal - holds the optimization analysis in a string which format follows the Optimization Services analysis Language (OSaL) schema.
isFile - holds whether the osal string is a file name or a string that literally holds the osal contents.
validate - holds whether the reader should be validating against the schema or not.
Returns:
the OSAnalysis object constructed from the OSaL String.
Throws:
java.lang.Exception - if there are errors in reading the string or setting the OSAnalyis.

writeOSaL

public java.lang.String writeOSaL()
                           throws java.lang.Exception
write the OSAnalysis to an osal xml string.

Returns:
the osal xml string.
Throws:
java.lang.Exception - if there are errors in writing the osal string.

getAnalysisStatus

public AnalysisStatus getAnalysisStatus()
Get analysis status

Returns:
analysis status.

setAnalysisStatus

public boolean setAnalysisStatus(AnalysisStatus status)
Set analysis status

Parameters:
status - holds the analysis status.
Returns:
whether the analysis status is set successfully.

getServiceURI

public java.lang.String getServiceURI()
Get service URI.

Returns:
the service URI, null or empty string if none.

setServiceURI

public boolean setServiceURI(java.lang.String serviceURI)
Set service URI.

Parameters:
serviceURI - holds the service URI.
Returns:
whether the service URI is set successfully.

getServiceName

public java.lang.String getServiceName()
Get service name.

Returns:
the service name, null or empty string if none.

setServiceName

public boolean setServiceName(java.lang.String serviceName)
Set service name.

Parameters:
serviceName - holds the service name.
Returns:
whether the service name is set successfully.

getInstanceName

public java.lang.String getInstanceName()
Get instance name.

Returns:
the instance name, null or empty string if none.

setInstanceName

public boolean setInstanceName(java.lang.String instanceName)
Set instance name.

Parameters:
instanceName - holds the instance name.
Returns:
whether the instance name is set successfully.

getJobID

public java.lang.String getJobID()
Get job ID.

Returns:
the job ID, null or empty string if none.

setJobID

public boolean setJobID(java.lang.String jobID)
Set jobID.

Parameters:
jobID - holds the jobID.
Returns:
whether the jobID is set successfully.

getAnalysisTime

public java.util.GregorianCalendar getAnalysisTime()
Get analysis time.

Returns:
the analysis time, null or empty string if none.

setAnalysisTime

public boolean setAnalysisTime(java.util.GregorianCalendar time)
Set analysis time.

Parameters:
time - holds the analysis time.
Returns:
whether the analysis time is set successfully.

getAnalysisMessage

public java.lang.String getAnalysisMessage()
Get analysis message.

Returns:
the analysis message, null or empty string if none.

setAnalysisMessage

public boolean setAnalysisMessage(java.lang.String message)
Set analysis message.

Parameters:
message - holds the analysis message.
Returns:
whether the analysis message is set successfully.

getVariableNumber

public int getVariableNumber()
Get variable number.

Returns:
variable number, -1 if no information.

setVariableNumber

public boolean setVariableNumber(int variableNumber)
Set the variable number.

Parameters:
variableNumber - holds the number of variables
Returns:
whether the variable number is set successfully or not.

getObjectiveNumber

public int getObjectiveNumber()
Get objective number.

Returns:
objective number, -1 if no information.

setObjectiveNumber

public boolean setObjectiveNumber(int objectiveNumber)
Set the objective number.

Parameters:
objectiveNumber - holds the number of objectives
Returns:
whether the objective number is set successfully or not.

getConstraintNumber

public int getConstraintNumber()
Get constraint number.

Returns:
constraint number, -1 if no information.

setConstraintNumber

public boolean setConstraintNumber(int constraintNumber)
Set the constraint number.

Parameters:
constraintNumber - holds the number of constraints
Returns:
whether the constraint number is set successfully or not.

getInstanceAnalysis

public InstanceAnalysis getInstanceAnalysis()
get analysis of the entire instance.

Returns:
InstanceAnalysis

setInstanceAnalysis

public boolean setInstanceAnalysis(InstanceAnalysis instanceAnalysis)
Set analysis of the entire instance. Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
instanceAnalysis - holds the analysis of the entire instance.
Returns:
whether the instanceAnalysis is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

getVariableAnalysis

public VariableAnalysis getVariableAnalysis()
get analysis of the variables

Returns:
VariableAnalysis

setVariableAnalysis

public boolean setVariableAnalysis(VariableAnalysis variableAnalysis)
Set analysis of the variables. Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
variableAnalysis - holds the analysis of the variables.
Returns:
whether the variableAnalysis is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

getObjectiveAnalysis

public ObjectiveAnalysis getObjectiveAnalysis()
get analysis of the objectives.

Returns:
ObjectiveAnalysis

setObjectiveAnalysis

public boolean setObjectiveAnalysis(ObjectiveAnalysis objectiveAnalysis)
Set analysis of the objectives. Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
objectiveAnalysis - holds the analysis of the objectives.
Returns:
whether the objectiveAnalysis is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

getConstraintAnalysis

public ConstraintAnalysis getConstraintAnalysis()
get analysis of the constraints.

Returns:
ConstraintAnalysis

setConstraintAnalysis

public boolean setConstraintAnalysis(ConstraintAnalysis constraintAnalysis)
Set analysis of the constraints. Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
constraintAnalysis - holds the analysis of the constraints.
Returns:
whether the constraintAnalysis is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

getLinearConstraintCoefficientAnalysis

public LinearConstraintCoefficientAnalysis getLinearConstraintCoefficientAnalysis()
get analysis of the linear constraint coefficients.

Returns:
LinearConstraintCoefficientAnalysis

setLinearConstraintCoefficientAnalysis

public boolean setLinearConstraintCoefficientAnalysis(LinearConstraintCoefficientAnalysis linearConstraintCoefficientAnalysis)
Set analysis of the linear constraint coefficients. Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
linearConstraintCoefficients - holds the analysis of the linear constraint coefficients.
Returns:
whether the linearConstraintCoefficientAnalysis is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

getQuadraticCoefficientAnalysis

public QuadraticCoefficientAnalysis getQuadraticCoefficientAnalysis()
get analysis of the entire quadratic coefficients.

Returns:
QuadraticCoefficientAnalysis

setQuadraticCoefficientAnalysis

public boolean setQuadraticCoefficientAnalysis(QuadraticCoefficientAnalysis quadraticCoefficientAnalysis)
Set analysis of the entire quadratic coefficients. Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
quadraticCoefficientAnalysis - holds the analysis of the entire quadratic coefficients.
Returns:
whether the quadraticCoefficientAnalysis is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

getNonlinearExpressionAnalysis

public NonlinearExpressionAnalysis getNonlinearExpressionAnalysis()
get analysis of the entire nonlinear expressions.

Returns:
NonlinearExpressions

setNonlinearExpressionAnalysis

public boolean setNonlinearExpressionAnalysis(NonlinearExpressionAnalysis nonlinearExpressionAnalysis)
Set analysis of the entire nonlinear expressions. Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
nonlinearExpressionAnalysis - holds the analysis of the entire nonlinear expressions.
Returns:
whether the nonlinearExpressionAnalysis is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

getOtherAnalysisNames

public java.lang.String[] getOtherAnalysisNames()
get a string array of names of other analyses.

Returns:
a string array of names of other analyses, null if no other analyses.

getOtherAnalysisDescriptions

public java.util.Hashtable<java.lang.String,java.lang.String> getOtherAnalysisDescriptions()
get a hashmap of other analysis descriptions. The keys of the hashmap are the analysis names, and the values of the hashmap are the analysis descriptions.

Returns:
a hashmap of other analysis descriptions, null if no other analyses.

getOtherAnalysisValues

public java.util.Hashtable<java.lang.String,java.lang.String> getOtherAnalysisValues()
get a hashmap of other analysis values. The keys of the hashmap are the analysis names, and the values of the hashmap are the analysis values.

Returns:
a hashmap of other analysis values, null if no other analyses.

setOtherAnalyses

public boolean setOtherAnalyses(java.lang.String[] names,
                                java.lang.String[] descriptions,
                                java.lang.String[] values)
set other analyses, with their names (required), descriptions (optional) and values (optional). Before this method is called, the setVariable(int), setObjective(int), setConstraint(int) methods have to be called first.

Parameters:
names - holds the names of the other analyses; it is required.
descriptions - holds the descriptions of the other analyses; null if none.
values - holds the values of the other analyses; null if none.
Returns:
whether the other anlysis information is set successfully.
See Also:
setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int)

main

public static void main(java.lang.String[] args)
main for test purposes.

Parameters:
argv - command line arguments.