28 #include "OSCommonUtil.h"
39 using std::ostringstream;
63 std::ostringstream outStr;
65 const char dirsep=
'\\';
67 const char dirsep=
'/';
71 xsltDir = dirsep ==
'/' ?
"../stylesheets/" :
"..\\stylesheets\\";
73 xsltDir =
"../stylesheets/";
76 cout <<
"in OSrLWriter" << endl;
79 outStr <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ;
80 outStr <<
"<?xml-stylesheet type=\"text/xsl\" href=\"";
82 outStr <<
"OSrL.xslt\"?>";
84 outStr <<
"<osrl xmlns=\"os.optimizationservices.org\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
85 outStr <<
"xsi:schemaLocation=\"os.optimizationservices.org http://www.optimizationservices.org/schemas/";
87 outStr <<
"/OSrL.xsd\" >" ;
90 cout <<
"output <general>" << endl;
93 outStr <<
"<general>" << endl;
95 outStr <<
"<generalStatus " ;
106 outStr <<
"/>" << endl;
125 outStr <<
"</general>" << endl;
128 cout <<
"output <system>" << endl;
133 cout <<
"output <service>" << endl;
138 cout <<
"output <job>" << endl;
141 outStr <<
"<job>" << endl;
144 { outStr <<
"<timingInformation numberOfTimes=\"";
147 { outStr <<
"<time ";
156 outStr <<
">" << endl;
158 outStr <<
"</time>" << endl;
160 outStr <<
"</timingInformation>" << endl;
162 outStr <<
"</job>" << endl;
165 cout <<
"output <optimization>" << endl;
168 outStr <<
"<optimization " ;
169 outStr <<
"numberOfSolutions=\"";
172 outStr <<
" numberOfVariables=\"";
175 outStr <<
" numberOfConstraints=\"";
178 outStr <<
" numberOfObjectives=\"";
181 outStr <<
">" << endl;
185 outStr <<
"<solution" ;
186 outStr <<
" targetObjectiveIdx=\"";
189 outStr <<
">" << endl;
193 outStr <<
" type=\"";
198 outStr <<
" description=\"";
202 outStr <<
"/>" << endl;
205 outStr <<
"<message>" << endl;
207 outStr <<
"</message>" << endl;
210 outStr <<
"<variables ";
213 outStr <<
">" << endl;
216 cout <<
"output <variables> <values>" << endl;
226 outStr <<
"</var>" << endl;
229 outStr <<
"</values>" << endl;
232 cout <<
"output <variables> <other>" << endl;
238 cout <<
" numberOfVar=\"";
247 cout <<
" description=\"";
253 outStr <<
" numberOfVar=\"";
258 outStr <<
" name=\"";
264 outStr <<
" value=\"";
270 outStr <<
" description=\"";
274 outStr <<
">" << endl;
283 outStr <<
"</var>" << endl;
287 outStr <<
"</other>" << endl;
291 outStr <<
"</variables>" << endl;
297 outStr <<
"<objectives ";
300 outStr <<
">" << endl;
302 cout <<
"output <objectives> <values>" << endl;
313 outStr <<
"</obj>" << endl;
316 outStr <<
"</values>" << endl;
319 cout <<
"output <objectives> <other>" << endl;
325 outStr <<
" name=\"";\
328 outStr <<
" description=\"";
331 outStr <<
">" << endl;
340 outStr <<
"</obj>" << endl;
344 outStr <<
"</other>" << endl;
348 outStr <<
"</objectives>" << endl;
351 outStr <<
"<constraints ";
354 outStr <<
">" << endl;
356 cout <<
"output <constraints> <dualValues>" << endl;
367 outStr <<
"</con>" << endl;
370 outStr <<
"</dualValues>" << endl;
373 cout <<
"output <constraints> <other>" << endl;
379 outStr <<
" name=\"";\
382 outStr <<
" description=\"";
385 outStr <<
">" << endl;
394 outStr <<
"</con>" << endl;
398 outStr <<
"</other>" << endl;
402 outStr <<
"</constraints>" << endl;
404 outStr <<
"</solution>" << endl;
407 outStr <<
"</optimization>" << endl;
410 cout <<
"done" << endl;
412 outStr <<
"</osrl>" << endl ;
OptimizationSolutionStatus * status
status is a pointer to an OptimizationSolutionStatus object associated with this optimization solutio...
std::string description
Further description on the timer used.
OtherConstraintResult ** other
a pointer to an array of other pointer objects for constraint functions
int numberOfVar
the number of variable values that are in the solution
std::string value
value is a value associated with the constraint indexed by idx, for example value might be the value ...
int numberOfOtherObjectiveResults
the number of types of objective function results other than the basic objective function values ...
TimingInformation * timingInformation
a pointer to the TimingInformation class
std::string value
this element allows a specific value associated with this particular type of result ...
OSrLWriter()
Default constructor.
std::string description
a brief description of the type of result
ObjValue ** obj
obj is a pointer to an array of ObjValue objects that give an index and objective function value for ...
DualVarValue ** con
con is a vector of DualVarValue objects that give an index and dual variable value for each constrain...
DualVariableValues * dualValues
a pointer to an array of DualVariableValues objects
std::string message
a message associated with this solution
JobResult * job
job holds the fourth child of the OSResult specified by the OSrL Schema.
std::string description
a brief description of the type of result
GeneralResult * general
general holds the first child of the OSResult specified by the OSrL Schema.
ServiceResult * service
service holds the third child of the OSResult specified by the OSrL Schema.
double value
the number of units
OptimizationResult * optimization
optimization holds the fifth child of the OSResult specified by the OSrL Schema.
SystemResult * system
system holds the second child of the OSResult specified by the OSrL Schema.
std::string value
value is a value associated with an objective function indexed by idx
std::string description
a brief description of the type of result
ObjectiveSolution * objectives
objectives holds the solution information for the objectives
std::string writeOSrL(OSResult *theosresult)
create an osrl string from an OSResult object
int numberOfVar
the number of variables which have values for this particular type of result
std::string message
any general message associated with the optimization
int numberOfCon
record the number of constraints for which values are given
VarValue ** var
a vector of VarValue objects, there will be one for each variable in the solution ...
VariableSolution * variables
variables holds the solution information for the variables
#define OS_SCHEMA_VERSION
int numberOfSolutions
numberOfSolutions is the number of objective functions reported.
std::string name
the name of the result the user is defining
std::string name
the name of the result the user is defining
VariableValues * values
a pointer to a VariableValues object
GeneralStatus * generalStatus
a pointer to the GeneralStatus class
OSResult * m_OSResult
m_OSResult is an object in the class OSResult, the data in m_OSResult are written to a string that va...
int numberOfCon
the number of constraints which have values for this particular type of result
std::string type
the type of solution status
int targetObjectiveIdx
the index of the objective function for which we are reporting solution information ...
std::string type
the type of status
OptimizationSolution ** solution
solution is an array of pointers to OptimizationSolution objects
ConstraintSolution * constraints
constraints holds the solution information for the constraints
ObjectiveValues * values
a pointer to an array of ObjectiveValues objects
std::string instanceName
the name of the instance that was solved
std::string serviceName
the serviceName is the name of the solver service that did the optimization
int numberOfConstraints
numberOfConstrants is the number of constraint functions reported in the solution.
std::string description
a description of the solution status type
std::string category
The category of time (total/input/preprocessing/optimization/postprocessing/output/other) ...
OtherVariableResult ** other
a pointer to an array of other pointer objects for variables
int numberOfObj
record the number of objective rows for which values are given
std::string serviceURI
the serviceURI is the URI of the solver service that did the optimization
std::string os_dtoa_format(double x)
std::string type
The type of timer used (cpuTime/elapsedTime/other)
OtherObjectiveResult ** other
a pointer to an array of other pointer objects for objective functions
int numberOfVariables
numberOfVariables is the number of variables reported in the solution.
int numberOfOtherConstraintResults
the number of types of constraint function results other than the basic constraint function values ...
int numberOfOtherVariableResults
the number of types of variable results other than the value of the variable
double value
the value of the objective indexed by idx
~OSrLWriter()
Class destructor.
int numberOfObj
the number of objectives which have values for this particular type of result
std::string jobID
the jobID is the ID associated with the solution of this instance
std::string value
value holds a general value associated with a variable, for example, rather than the value of a varia...
double value
value of dual variable on the constraint indexed by idx
std::string unit
the unit in which time is measured
int numberOfObjectives
numberOfObjectives is the number of objective functions reported in the solution. ...
std::string description
the description of the status
std::string name
the name of the result the user is defining