22#include "OSCommonUtil.h"
32using std::ostringstream;
53 std::ostringstream outStr;
55 const char dirsep=
'\\';
57 const char dirsep=
'/';
61 xsltDir = dirsep ==
'/' ?
"../stylesheets/" :
"..\\stylesheets\\";
63 xsltDir =
"../stylesheets/";
65 outStr <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ;
66 outStr <<
"<?xml-stylesheet type=\"text/xsl\" href=\"";
68 outStr <<
"OSoL.xslt\"?>";
69 outStr <<
"<osol xmlns=\"os.optimizationservices.org\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
70 outStr <<
"xsi:schemaLocation=\"os.optimizationservices.org http://www.optimizationservices.org/schemas/";
72 outStr <<
"/OSoL.xsd\" >" ;
79 { outStr <<
"<general>" << endl;
88 { outStr <<
"<instanceLocation>";
112 { outStr <<
"<contact>";
121 { outStr <<
"<otherOptions numberOfOtherOptions=\"";
129 outStr <<
"/>" << endl;
131 outStr <<
"</otherOptions>" << endl;
134 outStr <<
"</general>" << endl;
142 { outStr <<
"<system>" << endl;
166 { outStr <<
"<otherOptions numberOfOtherOptions=\"";
174 outStr <<
"/>" << endl;
176 outStr <<
"</otherOptions>" << endl;
179 outStr <<
"</system>" << endl;
180 cout <<
"Done with <system> element" << endl;
187 { outStr <<
"<service>" << endl;
193 { outStr <<
"<otherOptions numberOfOtherOptions=\"";
201 outStr <<
"/>" << endl;
203 outStr <<
"</otherOptions>" << endl;
206 outStr <<
"</service>" << endl;
207 cout <<
"Done with <service> element" << endl;
214 { outStr <<
"<job>" << endl;
220 outStr <<
"INF" <<
"</maxTime>" << endl;
228 { outStr <<
"<dependencies numberOfJobIDs=\"";
233 outStr <<
"</dependencies>" << endl;
238 { outStr <<
"<requiredDirectories numberOfPaths=\"";
242 outStr <<
"</requiredDirectories>" << endl;
247 { outStr <<
"<requiredFiles numberOfPaths=\"";
251 outStr <<
"</requiredFiles>" << endl;
256 { outStr <<
"<directoriesToMake numberOfPaths=\"";
260 outStr <<
"</directoriesToMake>" << endl;
265 { outStr <<
"<filesToMake numberOfPaths=\"";
269 outStr <<
"</filesToMake>" << endl;
274 { outStr <<
"<inputDirectoriesToMove numberOfPathPairs=\"";
277 { outStr <<
"<pathPair";
281 outStr <<
" makeCopy=\"true\"";
282 outStr <<
"/>" << endl;
284 outStr <<
"</inputDirectoriesToMove>" << endl;
289 { outStr <<
"<inputFilesToMove numberOfPathPairs=\"";
292 { outStr <<
"<pathPair";
296 outStr <<
" makeCopy=\"true\"";
297 outStr <<
"/>" << endl;
299 outStr <<
"</inputFilesToMove>" << endl;
304 { outStr <<
"<outputFilesToMove numberOfPathPairs=\"";
307 { outStr <<
"<pathPair";
311 outStr <<
" makeCopy=\"true\"";
312 outStr <<
"/>" << endl;
314 outStr <<
"</outputFilesToMove>" << endl;
319 { outStr <<
"<outputDirectoriesToMove numberOfPathPairs=\"";
322 { outStr <<
"<pathPair";
326 outStr <<
" makeCopy=\"true\"";
327 outStr <<
"/>" << endl;
329 outStr <<
"</outputDirectoriesToMove>" << endl;
334 { outStr <<
"<filesToDelete numberOfPaths=\"";
338 outStr <<
"</filesToDelete>" << endl;
343 { outStr <<
"<directoriesToDelete numberOfPaths=\"";
347 outStr <<
"</directoriesToDelete>" << endl;
352 { outStr <<
"<processesToKill numberOfProcesses=\"";
356 outStr <<
"</processesToKill>" << endl;
361 { outStr <<
"<otherOptions numberOfOtherOptions=\"";
369 outStr <<
"/>" << endl;
371 outStr <<
"</otherOptions>" << endl;
374 outStr <<
"</job>" << endl;
375 cout <<
"Done with <job> element" << endl;
382 { outStr <<
"<optimization";
386 outStr <<
">" << endl;
388 { outStr <<
"<variables";
391 outStr <<
">" << endl;
396 { outStr <<
"<initialVariableValues numberOfVar=\"";
402 { outStr <<
" value=\"";
410 outStr <<
"\"/>" << endl;
412 outStr <<
"</initialVariableValues>" << endl;
418 { outStr <<
"<initialVariableValuesString numberOfVar=\"";
424 outStr <<
"/>" << endl;
426 outStr <<
"</initialVariableValuesString>" << endl;
432 { outStr <<
"<initialBasisStatus numberOfVar=\"";
438 outStr <<
"/>" << endl;
440 outStr <<
"</initialBasisStatus>" << endl;
446 { outStr <<
"<integerVariableBranchingWeights numberOfVar=\"";
452 outStr <<
"/>" << endl;
454 outStr <<
"</integerVariableBranchingWeights>" << endl;
460 { outStr <<
"<sosVariableBranchingWeights numberOfSOS=\"";
462 cout <<
"start: numberOfSOS" << endl;
476 cout <<
"idx" << endl;
480 outStr <<
"/>" << endl;
482 outStr <<
"</sos>" << endl;
484 outStr <<
"</sosVariableBranchingWeights>" << endl;
493 cout <<
"option " << i <<
":" << endl;
513 outStr <<
">" << endl;
523 outStr <<
"/>" << endl;
525 outStr <<
"</other>" << endl;
527 outStr <<
"</variables>" << endl;
530 { outStr <<
"<objectives";
533 outStr <<
">" << endl;
535 { outStr <<
"<initialObjectiveValues numberOfObj=\"";
541 { outStr <<
" value=\"";
549 outStr <<
"\"/>" << endl;
551 outStr <<
"</initialObjectiveValues>" << endl;
554 { outStr <<
"<initialObjectiveBounds numberOfObj=\"";
559 outStr <<
" lbValue=\"";
566 outStr <<
"\" ubValue=\"";
573 outStr <<
"\"/>" << endl;
575 outStr <<
"</initialObjectiveBounds>" << endl;
584 cout <<
"option " << i <<
":" << endl;
605 outStr <<
">" << endl;
611 outStr <<
"/>" << endl;
613 outStr <<
"</other>" << endl;
615 outStr <<
"</objectives>" << endl;
618 { outStr <<
"<constraints";
621 outStr <<
">" << endl;
623 { outStr <<
"<initialConstraintValues numberOfCon=\"";
629 { outStr <<
" value=\"";
637 outStr <<
"\"/>" << endl;
639 outStr <<
"</initialConstraintValues>" << endl;
642 { outStr <<
"<initialDualValues numberOfCon=\"";
647 outStr <<
" lbDualValue=\"";
654 outStr <<
"\" ubDualValue=\"";
661 outStr <<
"\"/>" << endl;
663 outStr <<
"</initialDualValues>" << endl;
672 cout <<
"option " << i <<
":" << endl;
693 outStr <<
">" << endl;
703 outStr <<
"/>" << endl;
705 outStr <<
"</other>" << endl;
707 outStr <<
"</constraints>" << endl;
711 { outStr <<
"<solverOptions numberOfSolverOptions=\"";
725 outStr <<
"/>" << endl;
727 outStr <<
"</solverOptions>" << endl;
730 outStr <<
"</optimization>" << endl;
732 outStr <<
"</osol>" << endl;
std::string os_dtoa_format(double x)
double value
branching weight
int idx
index of the variable
std::string unit
the unit in which CPU speed is measured
double value
the CPU speed (expressed in multiples of unit)
InitConstraintValues * initialConstraintValues
initial values for the constraints
InitDualVariableValues * initialDualValues
initial dual values for the constraints
OtherConstraintOption ** other
other information about the constraints
int numberOfOtherConstraintOptions
number of <other> child elements
int numberOfPaths
the number of <path> children
std::string * path
the list of directory and file paths
OtherOptions * otherOptions
the list of other general options
InstanceLocationOption * instanceLocation
the location of the instance
std::string license
the license information
std::string serviceURI
the service URI
std::string serviceName
the name of the service
std::string jobID
the job ID
std::string userName
the username
std::string instanceName
the name of the instance
std::string solverToInvoke
the solver to invoke
std::string password
the password
ContactOption * contact
the contact method
double value
initial value
InitConValue ** con
initial value for each constraint
int numberOfCon
number of <con> children
double ubDualValue
initial upper bound
double lbDualValue
initial lower bound
int numberOfCon
number of <con> children
InitDualVarValue ** con
initial dual values for each constraint
double lbValue
initial lower bound
double ubValue
initial upper bound
double value
initial value
InitObjBound ** obj
initial bounds for each objective
int numberOfObj
number of <obj> children
InitObjValue ** obj
initial value for each objective
int numberOfObj
number of <obj> children
double value
initial value
std::string value
initial value
InitVarValue ** var
initial value for each variable
int numberOfVar
number of children
InitVarValueString ** var
initial value for each variable
int numberOfVar
number of children
std::string value
the value of the <instanceLocation> element
std::string locationType
the type of the location
BranchingWeight ** var
branching weight for each variable
int numberOfVar
number of children
std::string * jobID
the list of job IDs
int numberOfJobIDs
the number of entries in the list of job dependencies
Processes * processesToKill
processes to kill upon completion
DirectoriesAndFiles * requiredDirectories
directories required to run the job
DirectoriesAndFiles * filesToMake
files to make during the job
DirectoriesAndFiles * directoriesToDelete
directories to delete upon completion
std::string requestedStartTime
the requested time to start the job
DirectoriesAndFiles * requiredFiles
files required to run the job
DirectoriesAndFiles * filesToDelete
files to delete upon completion
JobDependencies * dependencies
the dependency set
PathPairs * inputFilesToMove
input files to move or copy
TimeSpan * maxTime
the maximum time allowed
PathPairs * outputDirectoriesToMove
output directories to move or copy
PathPairs * inputDirectoriesToMove
input directories to move or copy
PathPairs * outputFilesToMove
output files to move or copy
DirectoriesAndFiles * directoriesToMake
directories to make during the job
OtherOptions * otherOptions
list of other job options
OptimizationOption * optimization
optimizationOption holds the fifth child of the OSOption specified by the OSoL Schema.
GeneralOption * general
generalOption holds the first child of the OSOption specified by the OSoL Schema.
ServiceOption * service
serviceOption holds the third child of the OSOption specified by the OSoL Schema.
SystemOption * system
systemOption holds the second child of the OSOption specified by the OSoL Schema.
JobOption * job
jobOption holds the fourth child of the OSOption specified by the OSoL Schema.
std::string writeOSoL(OSOption *theosoption)
create an osol string from an OSOption object
OSoLWriter()
Default constructor.
~OSoLWriter()
Class destructor.
const OSOption * m_OSOption
m_OSOption is an object in the class OSOption
int numberOfOtherObjectiveOptions
number of <other> child elements
OtherObjectiveOption ** other
other information about the objectives
InitObjectiveValues * initialObjectiveValues
initial values for the objectives
InitObjectiveBounds * initialObjectiveBounds
initial bounds for the objectives
VariableOption * variables
the options for the variables
int numberOfConstraints
the number of constraints
ObjectiveOption * objectives
the options for the objectives
SolverOptions * solverOptions
other solver options
ConstraintOption * constraints
the options for the constraints
int numberOfObjectives
the number of objectives
int numberOfVariables
the number of variables
std::string lbValue
lower bound of the option
std::string ubValue
upper bound of the option
std::string value
value of the option
std::string category
name of the category into which this option falls
std::string name
name of the option
int numberOfCon
number of <con> children
OtherConOption ** con
array of option values
std::string type
type of the option value (integer, double, boolean, string)
std::string description
description of the option
std::string solver
name of the solver to which this option applies
std::string value
value of the option
std::string value
value of the option
OtherObjOption ** obj
array of option values
int numberOfObj
number of <obj> children
std::string name
name of the option
std::string value
value of the option
std::string solver
name of the solver to which this option applies
std::string category
name of the category into which this option falls
std::string type
type of the option value (integer, double, boolean, string)
std::string description
description of the option
std::string value
the value of the option
std::string description
the description of the option
std::string name
the name of the option
OtherOption ** other
the list of other options
int numberOfOtherOptions
the number of other options
std::string value
value of the option
std::string ubValue
lower bound on the value
std::string lbValue
lower bound on the value
int numberOfVar
number of child elements
std::string type
type of the option value (integer, double, boolean, string)
std::string name
name of the option
std::string solver
name of the solver to which this option applies
std::string category
name of the category into which this option falls
OtherVarOption ** var
array of option values
std::string description
description of the option
std::string value
value of the option
std::string from
the file or directory to move/copy from
bool makeCopy
record whether a copy is to be made
std::string to
the file or directory to move/copy to
PathPair ** pathPair
the list of directory and file paths
int numberOfPathPairs
the number of <path> children
std::string * process
the list of processes
int numberOfProcesses
the number of <process> children
SOSWeights ** sos
branching weights for the SOS
int numberOfSOS
number of <sos> children
BranchingWeight ** var
branching weights for individual variables
int sosIdx
index of the SOS (to match the OSiL file)
int numberOfVar
number of children
double groupWeight
branching weight for the entire SOS
std::string type
the service type
OtherOptions * otherOptions
the list of other service options
std::string value
the value of the option
std::string solver
the solver to which the option applies
std::string description
the description of the option
std::string type
the type of the option value (integer, double, boolean, string)
std::string category
the category to which the option belongs
std::string name
the name of the option
SolverOption ** solverOption
the list of solver options
int numberOfSolverOptions
the number of solver options
std::string unit
the unit in which storage capacity is measured
double value
the number of units of storage capacity
StorageCapacity * minDiskSpace
the minimum disk space required
StorageCapacity * minMemorySize
the minimum memory required
CPUSpeed * minCPUSpeed
the minimum CPU speed required
CPUNumber * minCPUNumber
the minimum number of processors required
OtherOptions * otherOptions
the list of other system options
std::string unit
the unit in which time is measured
double value
the number of units
BasisStatus * initialBasisStatus
initial basis information
int numberOfOtherVariableOptions
number of <other> child elements
InitVariableValuesString * initialVariableValuesString
initial values for string-valued variables
OtherVariableOption ** other
other variable options
SOSVariableBranchingWeights * sosVariableBranchingWeights
branching weights for SOS variables and groups
InitVariableValues * initialVariableValues
initial values for the variables
IntegerVariableBranchingWeights * integerVariableBranchingWeights
branching weights for integer variables
#define OS_SCHEMA_VERSION