The Result Class. More...
#include <OSResult.h>
Public Member Functions | |||||||
OSResult () | |||||||
Default constructor. | |||||||
~OSResult () | |||||||
Class destructor. | |||||||
GeneralStatus * | getGeneralStatus () | ||||||
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. | |||||||
OptimizationSolutionStatus * | getSolutionStatus (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.
string a pointer to the values of the var element
| |||||||
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 | |||||||
ResultHeader * | resultHeader | ||||||
resultHeader holds the first child of the OSResult specified by the OSiL Schema. | |||||||
ResultData * | resultData | ||||||
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. |
The Result Class.
Definition at line 959 of file OSResult.h.
OSResult::OSResult | ( | ) |
Default constructor.
OSResult::~OSResult | ( | ) |
Class destructor.
GeneralStatus* OSResult::getGeneralStatus | ( | ) |
Get the general status.
std::string OSResult::getGeneralStatusType | ( | ) |
Get the general status type, which can be: success, error, warning.
std::string OSResult::getGeneralStatusDescription | ( | ) |
Get the general status description.
std::string OSResult::getServiceName | ( | ) |
Get service name.
std::string OSResult::getServiceURI | ( | ) |
Get service uri.
std::string OSResult::getInstanceName | ( | ) |
Get instance name.
std::string OSResult::getJobID | ( | ) |
Get the job id.
std::string OSResult::getGeneralMessage | ( | ) |
Get the general message.
double* OSResult::getOptimalPrimalVariableValues | ( | int | objIdx | ) |
Get one solution of optimal primal variable values.
objIdx | holds the objective index the optimal value corresponds to. |
double* OSResult::getOptimalDualVariableValues | ( | int | objIdx | ) |
Get one solution of optimal dual variable values.
objIdx | holds the objective index the optimal value corresponds to. |
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.
solIdx | holds the solution index to get the solution status. |
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
solIdx | holds the solution index to get the solution status type. |
std::string OSResult::getSolutionStatusDescription | ( | int | solIdx | ) |
Get the [i]th optimization solution status description, where i equals the given solution index.
solIdx | holds the solution index to get the solution status description. |
std::string OSResult::getSolutionMessage | ( | int | solIdx | ) |
Get the [i]th optimization solution message, where i equals the given solution index.
solIdx | holds the solution index to get the solution message. |
int OSResult::getVariableNumber | ( | ) |
Get variable number.
int OSResult::getObjectiveNumber | ( | ) |
Get objective number.
int OSResult::getConstraintNumber | ( | ) |
Get constraint number.
int OSResult::getSolutionNumber | ( | ) |
get the number of solutions.
int OSResult::getNumberOfOtherVariableResult | ( | int | solIdx | ) |
Get numberOfOtherVariableResult.
bool OSResult::setGeneralStatus | ( | GeneralStatus * | status | ) |
Set the general status.
status | holds the general status. |
bool OSResult::setGeneralStatusType | ( | std::string | type | ) |
Set the general status type, which can be: success, error, warning.
type | holds the general status type |
bool OSResult::setGeneralStatusDescription | ( | std::string | description | ) |
Set the general status description.
description | holds the general status description. |
bool OSResult::setGeneralMessage | ( | std::string | message | ) |
Set the general message.
message | holds the general message. |
bool OSResult::setServiceName | ( | std::string | serviceName | ) |
Set service name.
serviceName | holds the name of the service. |
bool OSResult::setServiceURI | ( | std::string | serviceURI | ) |
Set service uri.
serviceURI | holds the uri of the service. |
bool OSResult::setInstanceName | ( | std::string | instanceName | ) |
Set instance name.
instanceName | holds the name of the instance. |
bool OSResult::setJobID | ( | std::string | jobID | ) |
Set job id.
jobID | holds the job id. |
bool OSResult::setVariableNumber | ( | int | variableNumber | ) |
Set the variable number.
variableNumber | holds the number of variables |
bool OSResult::setObjectiveNumber | ( | int | objectiveNumber | ) |
Set the objective number.
objectiveNumber | holds the number of objectives |
bool OSResult::setConstraintNumber | ( | int | constraintNumber | ) |
Set the constraint number.
constraintNumber | holds the number of constraints |
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.
number | holds the number of solutions to set. |
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.
solIdx | holds the solution index to set the solution status. | |
status | holds the optimization solution status to set. |
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.
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. |
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.
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. |
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
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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. * |
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.
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. |
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.
double* OSResult::m_mdPrimalValues |
m_mdPrimalValues a vector of primal variables.
Definition at line 1005 of file OSResult.h.
double* OSResult::m_mdDualValues |
m_mdDualValues a vector of primal variables.
Definition at line 1010 of file OSResult.h.