OSResult Class Reference

The Result Class. More...

#include <OSResult.h>

Collaboration diagram for OSResult:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 OSResult ()
 Default constructor.
 ~OSResult ()
 Class destructor.
GeneralStatusgetGeneralStatus ()
 Get the general status.
std::string getGeneralStatusType ()
 Get the general status type, which can be: success, error, warning.
std::string getGeneralStatusDescription ()
 Get the general status description.
std::string getServiceName ()
 Get service name.
std::string getServiceURI ()
 Get service uri.
std::string getInstanceName ()
 Get instance name.
std::string getJobID ()
 Get the job id.
std::string getGeneralMessage ()
 Get the general message.
double * getOptimalPrimalVariableValues (int objIdx)
 Get one solution of optimal primal variable values.
double * getOptimalDualVariableValues (int objIdx)
 Get one solution of optimal dual variable values.
OptimizationSolutionStatusgetSolutionStatus (int solIdx)
 Get the [i]th optimization solution status, where i equals the given solution index.
std::string getSolutionStatusType (int solIdx)
 Get the [i]th optimization solution status type, where i equals the given solution index.
std::string getSolutionStatusDescription (int solIdx)
 Get the [i]th optimization solution status description, where i equals the given solution index.
std::string getSolutionMessage (int solIdx)
 Get the [i]th optimization solution message, where i equals the given solution index.
int getVariableNumber ()
 Get variable number.
int getObjectiveNumber ()
 Get objective number.
int getConstraintNumber ()
 Get constraint number.
int getSolutionNumber ()
 get the number of solutions.
int getNumberOfOtherVariableResult (int solIdx)
 Get numberOfOtherVariableResult.
bool setGeneralStatus (GeneralStatus *status)
 Set the general status.
bool setGeneralStatusType (std::string type)
 Set the general status type, which can be: success, error, warning.
bool setGeneralStatusDescription (std::string description)
 Set the general status description.
bool setGeneralMessage (std::string message)
 Set the general message.
bool setServiceName (std::string serviceName)
 Set service name.
bool setServiceURI (std::string serviceURI)
 Set service uri.
bool setInstanceName (std::string instanceName)
 Set instance name.
bool setJobID (std::string jobID)
 Set job id.
bool setVariableNumber (int variableNumber)
 Set the variable number.
bool setObjectiveNumber (int objectiveNumber)
 Set the objective number.
bool setConstraintNumber (int constraintNumber)
 Set the constraint number.
bool setSolutionNumber (int number)
 set the number of solutions.
bool setSolutionStatus (int solIdx, std::string type, std::string description)
 Set the [i]th optimization solution status, where i equals the given solution index.
bool setSolutionObjectiveIndex (int solIdx, int objectiveIdx)
 Set the [i]th optimization solution's objective index, where i equals the given solution index.
bool setPrimalVariableValues (int solIdx, double *x)
 Set the [i]th optimization solution's primal variable values, where i equals the given solution index.
bool setNumberOfOtherVariableResult (int solIdx, int numberOfOtherVariableResult)
 Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.
holds the name of the other element

Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index
otherIdx holds the index of the new OtherVariableResult object

string a pointer to the values of the var element

Returns:
whether the other variable results are set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OtherVariableResult
org.optimizationservices.oscommon.datastructure.osresult.OtherVarResult
setSolutionNumber(int)


bool setAnOtherVariableResult (int solIdx, int otherIdx, std::string name, std::string description, std::string *s)
 Set the [i]th optimization solution's objective values, where i equals the given solution index.
bool setObjectiveValues (int solIdx, double *objectiveValues)
 Set the [i]th optimization solution's objective values, where i equals the given solution index.
bool setDualVariableValues (int solIdx, double *lbValues, double *ubValues)
 Set the [i]th optimization solution's dual variable values, where i equals the given solution index.
bool setDualVariableValues (int solIdx, double *y)
 Set the [i]th optimization solution's dual variable values, where i equals the given solution index.
bool setConstraintValues (int solIdx, double *constraintValues)
 Set the [i]th optimization solution's constraint values, where i equals the given solution index.

Public Attributes

ResultHeaderresultHeader
 resultHeader holds the first child of the OSResult specified by the OSiL Schema.
ResultDataresultData
 resultData holds the second child of the OSResult specified by the OSiL Schema.
int m_iVariableNumber
 m_iVariableNumber holds the variable number.
int m_iObjectiveNumber
 m_iObjectiveNumber holds the objective number.
int m_iConstraintNumber
 m_iConstraintNumber holds the constraint number.
int m_iNumberOfOtherVariableResult
 m_iNumberOfOtherVariableResult holds the number of OtherVariableResult objects.
double * m_mdPrimalValues
 m_mdPrimalValues a vector of primal variables.
double * m_mdDualValues
 m_mdDualValues a vector of primal variables.

Detailed Description

The Result Class.

Author:
Robert Fourer, Jun Ma, Kipp Martin
Version:
1.0, 03/14/2004
Since:
OS 1.0
Remarks:
A class for holding all the solution information.

Definition at line 959 of file OSResult.h.


Constructor & Destructor Documentation

OSResult::OSResult (  ) 

Default constructor.

OSResult::~OSResult (  ) 

Class destructor.


Member Function Documentation

GeneralStatus* OSResult::getGeneralStatus (  ) 

Get the general status.

Returns:
the general status.
std::string OSResult::getGeneralStatusType (  ) 

Get the general status type, which can be: success, error, warning.

Returns:
the general status type, null if none.
std::string OSResult::getGeneralStatusDescription (  ) 

Get the general status description.

Returns:
the general status description, null or empty std::string if none.
std::string OSResult::getServiceName (  ) 

Get service name.

Returns:
the service name.
std::string OSResult::getServiceURI (  ) 

Get service uri.

Returns:
the service uri.
std::string OSResult::getInstanceName (  ) 

Get instance name.

Returns:
the instance name.
std::string OSResult::getJobID (  ) 

Get the job id.

Returns:
the job id.
std::string OSResult::getGeneralMessage (  ) 

Get the general message.

Returns:
the general message.
double* OSResult::getOptimalPrimalVariableValues ( int  objIdx  ) 

Get one solution of optimal primal variable values.

Parameters:
objIdx holds the objective index the optimal value corresponds to.
Returns:
a double dense array of the optimal values, null if no optimal value.
double* OSResult::getOptimalDualVariableValues ( int  objIdx  ) 

Get one solution of optimal dual variable values.

Parameters:
objIdx holds the objective index the optimal value corresponds to.
Returns:
a double dense array of the optimal dual values, null if no optimal value.
OptimizationSolutionStatus* OSResult::getSolutionStatus ( int  solIdx  ) 

Get the [i]th optimization solution status, where i equals the given solution index.

The solution status includes the status type, optional descriptions and possibly substatuses.

Parameters:
solIdx holds the solution index to get the solution status.
Returns:
the optimization solution status that corresponds to solIdx, null if none.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OptimizationSolutionStatus
std::string OSResult::getSolutionStatusType ( int  solIdx  ) 

Get the [i]th optimization solution status type, where i equals the given solution index.

The solution status type can be: unbounded, globallyOptimal, locallyOptimal, optimal, bestSoFar, feasible, infeasible, stoppedByLimit, unsure, error, other

Parameters:
solIdx holds the solution index to get the solution status type.
Returns:
the optimization solution status type that corresponds to solIdx, null or empty std::string if none.
std::string OSResult::getSolutionStatusDescription ( int  solIdx  ) 

Get the [i]th optimization solution status description, where i equals the given solution index.

Parameters:
solIdx holds the solution index to get the solution status description.
Returns:
the optimization solution status description that corresponds to solIdx, null or empty std::string if none.
std::string OSResult::getSolutionMessage ( int  solIdx  ) 

Get the [i]th optimization solution message, where i equals the given solution index.

Parameters:
solIdx holds the solution index to get the solution message.
Returns:
the optimization solution message that corresponds to solIdx, null or empty if none.
int OSResult::getVariableNumber (  ) 

Get variable number.

Returns:
variable number, -1 if no information.
int OSResult::getObjectiveNumber (  ) 

Get objective number.

Returns:
objective number, -1 if no information.
int OSResult::getConstraintNumber (  ) 

Get constraint number.

Returns:
constraint number, -1 if no information.
int OSResult::getSolutionNumber (  ) 

get the number of solutions.

Returns:
the number of solutions, 0 if none.
int OSResult::getNumberOfOtherVariableResult ( int  solIdx  ) 

Get numberOfOtherVariableResult.

Returns:
numberOfOtherVariableResult, -1 if no information.
bool OSResult::setGeneralStatus ( GeneralStatus status  ) 

Set the general status.

Parameters:
status holds the general status.
Returns:
whether the general status is set successfully.
bool OSResult::setGeneralStatusType ( std::string  type  ) 

Set the general status type, which can be: success, error, warning.

Parameters:
type holds the general status type
Returns:
whether the general status type is set successfully or not.
bool OSResult::setGeneralStatusDescription ( std::string  description  ) 

Set the general status description.

Parameters:
description holds the general status description.
Returns:
whether the general status description is set successfully or not.
bool OSResult::setGeneralMessage ( std::string  message  ) 

Set the general message.

Parameters:
message holds the general message.
Returns:
whether process message is set successfully.
bool OSResult::setServiceName ( std::string  serviceName  ) 

Set service name.

Parameters:
serviceName holds the name of the service.
Returns:
whether the service name is set successfully.
bool OSResult::setServiceURI ( std::string  serviceURI  ) 

Set service uri.

Parameters:
serviceURI holds the uri of the service.
Returns:
whether the service uri is set successfully.
bool OSResult::setInstanceName ( std::string  instanceName  ) 

Set instance name.

Parameters:
instanceName holds the name of the instance.
Returns:
whether the instance name is set successfully.
bool OSResult::setJobID ( std::string  jobID  ) 

Set job id.

Parameters:
jobID holds the job id.
Returns:
whether the job id is set successfully.
bool OSResult::setVariableNumber ( int  variableNumber  ) 

Set the variable number.

Parameters:
variableNumber holds the number of variables
Returns:
whether the variable number is set successfully or not.
bool OSResult::setObjectiveNumber ( int  objectiveNumber  ) 

Set the objective number.

Parameters:
objectiveNumber holds the number of objectives
Returns:
whether the objective number is set successfully or not.
bool OSResult::setConstraintNumber ( int  constraintNumber  ) 

Set the constraint number.

Parameters:
constraintNumber holds the number of constraints
Returns:
whether the constraint number is set successfully or not.
bool OSResult::setSolutionNumber ( int  number  ) 

set the number of solutions.

This method must be called before setting other optimization solution related results. Before this method is called, the setVariableNumber(int), setObjectiveNumber(int), setConstraintNumber(int) methods have to be called first.

Parameters:
number holds the number of solutions to set.
Returns:
whether the solution number is set successfully.
See also:
setVariableNumber(int)
setObjectiveNumber(int)
setConstraintNumber(int)
bool OSResult::setSolutionStatus ( int  solIdx,
std::string  type,
std::string  description 
)

Set the [i]th optimization solution status, where i equals the given solution index.

The solution status includes the status type, optional descriptions and possibly substatuses. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the solution status.
status holds the optimization solution status to set.
Returns:
whether the optimization solution status is set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OptimizationSolutionStatus
setSolutionNumber(int)
bool OSResult::setSolutionObjectiveIndex ( int  solIdx,
int  objectiveIdx 
)

Set the [i]th optimization solution's objective index, where i equals the given solution index.

The first objective's index should be -1, the second -2, and so on. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
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.
Returns:
whether the optimization objective index is set successfully or not.
See also:
setSolutionNumber(int)
bool OSResult::setPrimalVariableValues ( int  solIdx,
double *  x 
)

Set the [i]th optimization solution's primal variable values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the primal variable values.
x holds the a double dense array of variable values to set; it could be null if all variables are 0.
Returns:
whether primal variable values are set successfully or not.
See also:
setSolutionNumber(int)
bool OSResult::setNumberOfOtherVariableResult ( int  solIdx,
int  numberOfOtherVariableResult 
)

Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first. This method then allocates the memory for the new OtherVariableResult objects

Parameters:
solIdx is the solution index
numberOfOtherVariableResult holds the number of OtherVariableResult objects Each other variable result contains the name (required), an optional description (std::string) and an optional value (std::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 std::string value.
Returns:
whether the other variable results are set successfully or not.
See also:
org.optimizationservices.oscommon.datastructure.osresult.OtherVariableResult
org.optimizationservices.oscommon.datastructure.osresult.OtherVarResult
setSolutionNumber(int)
bool OSResult::setAnOtherVariableResult ( int  solIdx,
int  otherIdx,
std::string  name,
std::string  description,
std::string *  s 
)

Set the [i]th optimization solution's objective values, where i equals the given solution index.

Usually one of the objective is what the solution was solved for (or based on). Its index should be indicated in the solution's objectiveIdx attribute. Based on this objective's solution, the rest of the objective values are (optionally) calculated. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective values.
objectiveValues holds the 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.
Returns:
whether objective values are set successfully or not.
See also:
setSolutionNumber(int)
bool OSResult::setObjectiveValues ( int  solIdx,
double *  objectiveValues 
)

Set the [i]th optimization solution's objective values, where i equals the given solution index.

Usually one of the objective is what the solution was solved for (or based on). Its index should be indicated in the solution's objectiveIdx attribute. Based on this objective's solution, the rest of the objective values are (optionally) calculated. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the objective values.
objectiveValues holds the 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.
Returns:
whether objective values are set successfully or not.
See also:
setSolutionNumber(int)
bool OSResult::setDualVariableValues ( int  solIdx,
double *  lbValues,
double *  ubValues 
)

Set the [i]th optimization solution's dual variable values, where i equals the given solution index.

The method allows setting dual values at both the constraints' lower and upper bounds. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the dual variable values.
lbValues holds the a double dense array of variable dual values to set at the lower bounds; it could be null if all values are 0.
ubValues holds the a double dense array of variable dual values to set at the upper bounds; it could be null if all values are 0.
Returns:
whether dual variable values are set successfully or not.
See also:
setSolutionNumber(int)
bool OSResult::setDualVariableValues ( int  solIdx,
double *  y 
)

Set the [i]th optimization solution's dual variable values, where i equals the given solution index.

The method allows setting dual values at both the constraints' lower and upper bounds. Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the dual variable values.
y holds the a double dense array of variable dual values; it could be null if all values are 0. *
Returns:
whether dual variable values are set successfully or not.
See also:
setSolutionNumber(int)
bool OSResult::setConstraintValues ( int  solIdx,
double *  constraintValues 
)

Set the [i]th optimization solution's constraint values, where i equals the given solution index.

Before this method is called, the setSolutionNumber(int) method has to be called first.

Parameters:
solIdx holds the solution index to set the constraint values.
constraintValues holds the a double dense array of constraint values to set; it could be null if all constraint values are 0.
Returns:
whether constraint values are set successfully or not.
See also:
setSolutionNumber(int)

Member Data Documentation

resultHeader holds the first child of the OSResult specified by the OSiL Schema.

Definition at line 975 of file OSResult.h.

resultData holds the second child of the OSResult specified by the OSiL Schema.

Definition at line 979 of file OSResult.h.

m_iVariableNumber holds the variable number.

Definition at line 985 of file OSResult.h.

m_iObjectiveNumber holds the objective number.

Definition at line 990 of file OSResult.h.

m_iConstraintNumber holds the constraint number.

Definition at line 995 of file OSResult.h.

m_iNumberOfOtherVariableResult holds the number of OtherVariableResult objects.

Definition at line 1000 of file OSResult.h.

m_mdPrimalValues a vector of primal variables.

Definition at line 1005 of file OSResult.h.

m_mdDualValues a vector of primal variables.

Definition at line 1010 of file OSResult.h.


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

Generated on 15 Mar 2015 for Coin-All by  doxygen 1.6.1