My Project
OSrLWriter.cpp
Go to the documentation of this file.
1 /* $Id$ */
17 #include "OSrLWriter.h"
18 #include "OSResult.h"
19 #include "OSgLWriter.h"
20 #include "OSGeneral.h"
21 #include "OSStringUtil.h"
22 #include "OSParameters.h"
23 #include "OSConfig.h"
24 #include "OSOutput.h"
25 #include "OSBase64.h"
26 #include "OSMathUtil.h"
27 #include <sstream>
28 #include <iostream>
29 #include <stdio.h>
30 
31 using std::endl;
32 using std::ostringstream;
33 
35 {
36  m_bWriteBase64 = false;
37  m_bWhiteSpace = false;
38 }
39 
41 {
42 }
43 
44 
45 std::string OSrLWriter::writeOSrL( OSResult *theosresult)
46 {
47  m_OSResult = theosresult;
48  std::ostringstream outStr;
49 #ifdef WIN_
50  const char dirsep='\\';
51 #else
52  const char dirsep='/';
53 #endif
54  // Set directory containing stylesheet files.
55  // std::string xsltDir;
56  // xsltDir = dirsep == '/' ? "../stylesheets/" : "..\\stylesheets\\";
57  // always go with '/' -- it is a hypertext reference
58  // xsltDir = "../stylesheets/";
59  // xsltDir = "http://www.coin-or.org/OS/stylesheets/";
60 
61  // 31 May 2013 --- HIG
62  // some browsers consider it a security risk to allow remote stylesheets
63  // or even relative addresses containing "../", So we must make sure that
64  // the stylesheet is located in the same directory as the OSrL file
65 
66  int i, j;
67  bool generalTagPrinted;
68  bool systemTagPrinted;
69  bool serviceTagPrinted;
70  bool jobTagPrinted;
71 #ifndef NDEBUG
73 #endif
74 
75  if(m_OSResult == NULL) return outStr.str();
76  outStr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ;
77  outStr << "<?xml-stylesheet type=\"text/xsl\" href=\"";
78  // outStr << xsltDir;
79  outStr << "OSrL.xslt\"?>";
80  outStr << endl;
81  outStr << "<osrl xmlns=\"os.optimizationservices.org\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
82  outStr << "xsi:schemaLocation=\"os.optimizationservices.org http://www.optimizationservices.org/schemas/";
83  outStr << OS_SCHEMA_VERSION;
84  outStr << "/OSrL.xsd\" >" ;
85  outStr << endl;
86 
87 #ifndef NDEBUG
88  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <resultHeader>");
89 #endif
90  if(m_OSResult->resultHeader != NULL)
91  {
92  if (m_OSResult->resultHeader->name != "" ||
93  m_OSResult->resultHeader->source != "" ||
97  {
98  outStr << "<resultHeader>" << endl;
100  outStr << "</resultHeader>" << endl;
101  }
102  }
103 
104 
105 #ifndef NDEBUG
106  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <general>");
107 #endif
108  if(m_OSResult->general != NULL)
109  {
110  generalTagPrinted = false;
111  if(m_OSResult->general->generalStatus != NULL)
112  {
113  if (generalTagPrinted == false)
114  {
115  outStr << "<general>" << endl;
116  generalTagPrinted = true;
117  }
118  outStr << "<generalStatus";
119  if(m_OSResult->general->generalStatus->type.length() > 0)
120  {
121  outStr << " type=\"";
122  outStr << m_OSResult->general->generalStatus->type ;
123  outStr << "\"";
124  }
125  if(m_OSResult->general->generalStatus->description.length() > 0)
126  {
127  outStr << " description=";
129  }
131  {
132  outStr << " numberOfSubstatuses=\"";
134  outStr << "\"";
135  }
136  outStr << ">" << endl;
137  for (int i=0; i < m_OSResult->general->generalStatus->numberOfSubstatuses; i++)
138  {
139  outStr << "<substatus";
140  if (m_OSResult->general->generalStatus->substatus[i]->name.length() > 0)
141  {
142  outStr << " name=\"";
143  outStr << m_OSResult->general->generalStatus->substatus[i]->name ;
144  outStr << "\"";
145  }
146  if (m_OSResult->general->generalStatus->substatus[i]->description.length() > 0)
147  {
148  outStr << " description=\"";
150  outStr << "\"";
151  }
152  outStr << "/>" << endl;
153  }
154  outStr << "</generalStatus>" << endl;
155  }
156 
157  if(m_OSResult->general->message.length() > 0)
158  {
159  if (generalTagPrinted == false)
160  {
161  outStr << "<general>" << endl;
162  generalTagPrinted = true;
163  }
164  outStr << "<message>" + m_OSResult->general->message + "</message>" << endl;
165  }
166  if(m_OSResult->general->serviceURI.length() > 0)
167  {
168  if (generalTagPrinted == false)
169  {
170  outStr << "<general>" << endl;
171  generalTagPrinted = true;
172  }
173  outStr << "<serviceURI>" + m_OSResult->general->serviceURI + "</serviceURI>" << endl;
174  }
175  if(m_OSResult->general->serviceName.length() > 0)
176  {
177  if (generalTagPrinted == false)
178  {
179  outStr << "<general>" << endl;
180  generalTagPrinted = true;
181  }
182  outStr << "<serviceName>" + m_OSResult->general->serviceName + "</serviceName>" << endl;
183  }
184  if(m_OSResult->general->instanceName.length() > 0)
185  {
186  if (generalTagPrinted == false)
187  {
188  outStr << "<general>" << endl;
189  generalTagPrinted = true;
190  }
191  outStr << "<instanceName>" + m_OSResult->general->instanceName + "</instanceName>" << endl;
192  }
193  if(m_OSResult->general->jobID.length() > 0)
194  {
195  if (generalTagPrinted == false)
196  {
197  outStr << "<general>" << endl;
198  generalTagPrinted = true;
199  }
200  outStr << "<jobID>" + m_OSResult->general->jobID + "</jobID>" << endl;
201  }
202  if(m_OSResult->general->solverInvoked.length() > 0)
203  {
204  if (generalTagPrinted == false)
205  {
206  outStr << "<general>" << endl;
207  generalTagPrinted = true;
208  }
209  outStr << "<solverInvoked>" + m_OSResult->general->solverInvoked + "</solverInvoked>" << endl;
210  }
211  if(m_OSResult->general->timeStamp.length() > 0)
212  {
213  if (generalTagPrinted == false)
214  {
215  outStr << "<general>" << endl;
216  generalTagPrinted = true;
217  }
218  outStr << "<timeStamp>" + m_OSResult->general->timeStamp + "</timeStamp>" << endl;
219  }
220 
221  if(m_OSResult->general->otherResults != NULL)
222  {
224  {
225  if (generalTagPrinted == false)
226  {
227  outStr << "<general>" << endl;
228  generalTagPrinted = true;
229  }
230  outStr << "<otherResults numberOfOtherResults=\"";
232  outStr << "\">" << endl;
233  for (int i=0; i < m_OSResult->general->otherResults->numberOfOtherResults; i++)
234  {
235  outStr << "<other";
236  if (m_OSResult->general->otherResults->other[i]->name.length() > 0)
237  {
238  outStr << " name=";
240  }
241  if (m_OSResult->general->otherResults->other[i]->value.length() > 0)
242  {
243  outStr << " value=";
245  }
246  if (m_OSResult->general->otherResults->other[i]->description.length() > 0)
247  {
248  outStr << " description=";
250  }
251  outStr << " />" << endl;
252  }
253  outStr << "</otherResults>" << endl;;
254  }
255  }
256  if (generalTagPrinted == true)
257  outStr << "</general>" << endl;
258  }
259 
260 
261 #ifndef NDEBUG
262  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <system>");
263 #endif
264  if(m_OSResult->system != NULL)
265  {
266  systemTagPrinted = false;
267  if(m_OSResult->system->systemInformation.length() > 0)
268  {
269  if (systemTagPrinted == false)
270  {
271  outStr << "<system>" << endl;
272  systemTagPrinted = true;
273  }
274  outStr << "<systemInformation>" + m_OSResult->system->systemInformation + "</systemInformation>" << endl;
275  }
276 
277  if(m_OSResult->system->availableDiskSpace != NULL)
278  {
279  if (systemTagPrinted == false)
280  {
281  outStr << "<system>" << endl;
282  systemTagPrinted = true;
283  }
284  outStr << "<availableDiskSpace";
285  if(m_OSResult->system->availableDiskSpace->unit.length() > 0)
286  {
287  outStr << " unit=\"";
289  outStr << "\"";
290  }
291  if(m_OSResult->system->availableDiskSpace->description.length() > 0)
292  {
293  outStr << " description=";
295  }
296  outStr << ">";
298  outStr << "</availableDiskSpace>" << endl;
299  }
300 
301  if(m_OSResult->system->availableMemory != NULL)
302  {
303  if (systemTagPrinted == false)
304  {
305  outStr << "<system>" << endl;
306  systemTagPrinted = true;
307  }
308  outStr << "<availableMemory";
309  if(m_OSResult->system->availableMemory->unit.length() > 0)
310  {
311  outStr << " unit=\"";
312  outStr << m_OSResult->system->availableMemory->unit;
313  outStr << "\"";
314  }
315  if(m_OSResult->system->availableMemory->description.length() > 0)
316  {
317  outStr << " description=";
319  }
320  outStr << ">";
322  outStr << "</availableMemory>" << endl;
323  }
324 
325  if(m_OSResult->system->availableCPUSpeed != NULL)
326  {
327  if (systemTagPrinted == false)
328  {
329  outStr << "<system>" << endl;
330  systemTagPrinted = true;
331  }
332  outStr << "<availableCPUSpeed";
333  if(m_OSResult->system->availableCPUSpeed->unit.length() > 0)
334  {
335  outStr << " unit=\"";
336  outStr << m_OSResult->system->availableCPUSpeed->unit ;
337  outStr << "\"";
338  }
339  if(m_OSResult->system->availableCPUSpeed->description.length() > 0)
340  {
341  outStr << " description=";
343  }
344  outStr << ">";
346  outStr << "</availableCPUSpeed>" << endl;
347  }
348 
349  if(m_OSResult->system->availableCPUNumber != NULL)
350  {
351  if (systemTagPrinted == false)
352  {
353  outStr << "<system>" << endl;
354  systemTagPrinted = true;
355  }
356  outStr << "<availableCPUNumber";
357  if(m_OSResult->system->availableCPUNumber->description.length() > 0)
358  {
359  outStr << " description=";
361  }
362  outStr << ">";
364  outStr << "</availableCPUNumber>" << endl;
365  }
366 
367  if(m_OSResult->system->otherResults != NULL)
368  {
370  {
371  if (systemTagPrinted == false)
372  {
373  outStr << "<system>" << endl;
374  systemTagPrinted = true;
375  }
376  outStr << "<otherResults numberOfOtherResults=\"";
378  outStr << "\">" << endl;
379  for (int i=0; i < m_OSResult->system->otherResults->numberOfOtherResults; i++)
380  {
381  outStr << "<other";
382  if (m_OSResult->system->otherResults->other[i]->name.length() > 0)
383  {
384  outStr << " name=";
386  }
387  if (m_OSResult->system->otherResults->other[i]->value.length() > 0)
388  {
389  outStr << " value=";
391  }
392  if (m_OSResult->system->otherResults->other[i]->description.length() > 0)
393  {
394  outStr << " description=";
396  }
397  outStr << " />" << endl;
398  }
399  outStr << "</otherResults>" << endl;
400  }
401  }
402  if (systemTagPrinted == true)
403  outStr << "</system>" << endl;
404  }
405 
406 
407 #ifndef NDEBUG
408  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <service>");
409 #endif
410  if(m_OSResult->service != NULL)
411  {
412  serviceTagPrinted = false;
413  if(m_OSResult->service->currentState.length() > 0 && m_OSResult->service->currentState != "unknown")
414  {
415  if (serviceTagPrinted == false)
416  {
417  outStr << "<service>" << endl;
418  serviceTagPrinted = true;
419  }
420  outStr << "<currentState>" << m_OSResult->service->currentState << "</currentState>" << endl;
421  }
423  {
424  if (serviceTagPrinted == false)
425  {
426  outStr << "<service>" << endl;
427  serviceTagPrinted = true;
428  }
429  outStr << "<currentJobCount>" << m_OSResult->service->currentJobCount << "</currentJobCount>" << endl;
430  }
432  {
433  if (serviceTagPrinted == false)
434  {
435  outStr << "<service>" << endl;
436  serviceTagPrinted = true;
437  }
438  outStr << "<totalJobsSoFar>" << m_OSResult->service->totalJobsSoFar << "</totalJobsSoFar>" << endl;
439  }
440  if(m_OSResult->service->timeServiceStarted.length() > 0 && m_OSResult->service->timeServiceStarted != "1970-01-01T00:00:00-00:00")
441  {
442  if (serviceTagPrinted == false)
443  {
444  outStr << "<service>" << endl;
445  serviceTagPrinted = true;
446  }
447  outStr << "<timeServiceStarted>" << m_OSResult->service->timeServiceStarted << "</timeServiceStarted>" << endl;
448  }
450  {
451  if (serviceTagPrinted == false)
452  {
453  outStr << "<service>" << endl;
454  serviceTagPrinted = true;
455  }
456  outStr << "<serviceUtilization>" << os_dtoa_format(m_OSResult->service->serviceUtilization) << "</serviceUtilization>" << endl;
457  }
458 
459  if(m_OSResult->service->otherResults != NULL)
460  {
462  {
463  if (serviceTagPrinted == false)
464  {
465  outStr << "<service>" << endl;
466  serviceTagPrinted = true;
467  }
468  outStr << "<otherResults numberOfOtherResults=\"";
470  outStr << "\">" << endl;
471  for (int i=0; i < m_OSResult->service->otherResults->numberOfOtherResults; i++)
472  {
473  outStr << "<other";
474  if (m_OSResult->service->otherResults->other[i]->name.length() > 0)
475  {
476  outStr << " name=";
478  }
479  if (m_OSResult->service->otherResults->other[i]->value.length() > 0)
480  {
481  outStr << " value=";
483  }
484  if (m_OSResult->service->otherResults->other[i]->description.length() > 0)
485  {
486  outStr << " description=";
488  }
489  outStr << " />" << endl;
490  }
491  outStr << "</otherResults>" << endl;
492  }
493  }
494  if (serviceTagPrinted == true)
495  outStr << "</service>" << endl;
496  }
497 
498 
499 #ifndef NDEBUG
501 #endif
502  if(m_OSResult->job != NULL)
503  {
504  jobTagPrinted = false;
505 
506  if(m_OSResult->job->status.length() > 0 && m_OSResult->job->status != "finished")
507  {
508  if (jobTagPrinted == false)
509  {
510  outStr << "<job>" << endl;
511  jobTagPrinted = true;
512  }
513  outStr << "<status>" + m_OSResult->job->status + "</status>" << endl;
514  }
515  if(m_OSResult->job->submitTime.length() > 0 && m_OSResult->job->submitTime != "1970-01-01T00:00:00-00:00")
516  {
517  if (jobTagPrinted == false)
518  {
519  outStr << "<job>" << endl;
520  jobTagPrinted = true;
521  }
522  outStr << "<submitTime>" + m_OSResult->job->submitTime + "</submitTime>" << endl;
523  }
524  if(m_OSResult->job->scheduledStartTime.length() > 0 && m_OSResult->job->scheduledStartTime != "1970-01-01T00:00:00-00:00")
525  {
526  if (jobTagPrinted == false)
527  {
528  outStr << "<job>" << endl;
529  jobTagPrinted = true;
530  }
531  outStr << "<scheduledStartTime>" + m_OSResult->job->scheduledStartTime + "</scheduledStartTime>" << endl;
532  }
533  if(m_OSResult->job->actualStartTime.length() > 0 && m_OSResult->job->actualStartTime != "1970-01-01T00:00:00-00:00")
534  {
535  if (jobTagPrinted == false)
536  {
537  outStr << "<job>" << endl;
538  jobTagPrinted = true;
539  }
540  outStr << "<actualStartTime>" + m_OSResult->job->actualStartTime + "</actualStartTime>" << endl;
541  }
542  if(m_OSResult->job->endTime.length() > 0 && m_OSResult->job->endTime != "1970-01-01T00:00:00-00:00")
543  {
544  if (jobTagPrinted == false)
545  {
546  outStr << "<job>" << endl;
547  jobTagPrinted = true;
548  }
549  outStr << "<endTime>" + m_OSResult->job->endTime + "</endTime>" << endl;
550  }
551 
552  if (m_OSResult->job->timingInformation != NULL)
553  {
554  if (jobTagPrinted == false)
555  {
556  outStr << "<job>" << endl;
557  jobTagPrinted = true;
558  }
559  outStr << "<timingInformation numberOfTimes=\"";
560  outStr << m_OSResult->job->timingInformation->numberOfTimes << "\">" << endl;
561  for (i=0; i<m_OSResult->job->timingInformation->numberOfTimes; i++)
562  {
563  outStr << "<time";
564  if (m_OSResult->job->timingInformation->time[i]->type != "")
565  outStr << " type=\"" << m_OSResult->job->timingInformation->time[i]->type << "\"";
566  if (m_OSResult->job->timingInformation->time[i]->unit != "")
567  outStr << " unit=\"" << m_OSResult->job->timingInformation->time[i]->unit << "\"";
568  if (m_OSResult->job->timingInformation->time[i]->category != "")
569  outStr << " category=\"" << m_OSResult->job->timingInformation->time[i]->category << "\"";
571  outStr << " description=" << writeStringData(m_OSResult->job->timingInformation->time[i]->description);
572  outStr << ">" << endl;
574  outStr << "</time>" << endl;
575  }
576  outStr << "</timingInformation>" << endl;
577  }
578 
579  if(m_OSResult->job->usedDiskSpace != NULL)
580  {
581  if (jobTagPrinted == false)
582  {
583  outStr << "<job>" << endl;
584  jobTagPrinted = true;
585  }
586  outStr << "<usedDiskSpace";
587  if(m_OSResult->job->usedDiskSpace->unit.length() > 0)
588  {
589  outStr << " unit=\"";
590  outStr << m_OSResult->job->usedDiskSpace->unit ;
591  outStr << "\"";
592  }
593  if(m_OSResult->job->usedDiskSpace->description.length() > 0)
594  {
595  outStr << " description=";
597  }
598  outStr << ">";
600  outStr << "</usedDiskSpace>" << endl;
601  }
602 
603  if(m_OSResult->job->usedMemory != NULL)
604  {
605  if (jobTagPrinted == false)
606  {
607  outStr << "<job>" << endl;
608  jobTagPrinted = true;
609  }
610  outStr << "<usedMemory";
611  if(m_OSResult->job->usedMemory->unit.length() > 0)
612  {
613  outStr << " unit=\"";
614  outStr << m_OSResult->job->usedMemory->unit ;
615  outStr << "\"";
616  }
617  if(m_OSResult->job->usedMemory->description.length() > 0)
618  {
619  outStr << " description=";
621  }
622  outStr << ">";
624  outStr << "</usedMemory>" << endl;
625  }
626 
627  if(m_OSResult->job->usedCPUSpeed != NULL)
628  {
629  if (jobTagPrinted == false)
630  {
631  outStr << "<job>" << endl;
632  jobTagPrinted = true;
633  }
634  outStr << "<usedCPUSpeed";
635  if(m_OSResult->job->usedCPUSpeed->unit.length() > 0)
636  {
637  outStr << " unit=\"";
638  outStr << m_OSResult->job->usedCPUSpeed->unit ;
639  outStr << "\"";
640  }
641  if(m_OSResult->job->usedCPUSpeed->description.length() > 0)
642  {
643  outStr << " description=";
645  }
646  outStr << ">";
648  outStr << "</usedCPUSpeed>" << endl;
649  }
650 
651  if(m_OSResult->job->usedCPUNumber != NULL)
652  {
653  if (jobTagPrinted == false)
654  {
655  outStr << "<job>" << endl;
656  jobTagPrinted = true;
657  }
658  outStr << "<usedCPUNumber";
659  if(m_OSResult->job->usedCPUNumber->description.length() > 0)
660  {
661  outStr << " description=";
663  }
664  outStr << ">";
665  outStr << m_OSResult->job->usedCPUNumber->value;
666  outStr << "</usedCPUNumber>" << endl;
667  }
668 
669  if(m_OSResult->job->otherResults != NULL)
670  {
672  {
673  if (jobTagPrinted == false)
674  {
675  outStr << "<job>" << endl;
676  jobTagPrinted = true;
677  }
678  outStr << "<otherResults numberOfOtherResults=\"";
680  outStr << "\">" << endl;
681  for (int i=0; i < m_OSResult->job->otherResults->numberOfOtherResults; i++)
682  {
683  outStr << "<other";
684  if (m_OSResult->job->otherResults->other[i]->name.length() > 0)
685  {
686  outStr << " name=";
688  }
689  if (m_OSResult->job->otherResults->other[i]->value.length() > 0)
690  {
691  outStr << " value=";
693  }
694  if (m_OSResult->job->otherResults->other[i]->description.length() > 0)
695  {
696  outStr << " description=";
698  }
699  outStr << " />" << endl;
700  }
701  outStr << "</otherResults>" << endl;
702  }
703  }
704  if (jobTagPrinted == true)
705  outStr << "</job>" << endl;
706  }
707 
708 
709 #ifndef NDEBUG
710  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <optimization>");
711 #endif
712  if(m_OSResult->optimization != NULL)
713  {
714  outStr << "<optimization " ;
715  outStr << "numberOfSolutions=\"";
717  outStr << "\"";
719  {
720  outStr << " numberOfVariables=\"";
722  outStr << "\"";
723  }
725  {
726  outStr << " numberOfConstraints=\"";
728  outStr << "\"";
729  }
731  {
732  outStr << " numberOfObjectives=\"";
734  outStr << "\"" ;
735  }
736  outStr << ">" << endl;
737  // get solution information
738  for(i = 0; i < m_OSResult->optimization->numberOfSolutions; i++)
739  {
740  if(m_OSResult->optimization->solution[i] != NULL)
741  {
742  outStr << "<solution" ;
743  outStr << " targetObjectiveIdx=\"";
745  outStr << "\"" ;
746  if (m_OSResult->optimization->solution[i]->targetObjectiveName.length() > 0)
747  {
748  outStr << " targetObjectiveName=";
750  }
752  outStr << " weightedObjectives=\"true\"";
753  outStr << ">" << endl;
754  if(m_OSResult->optimization->solution[i]->status != NULL)
755  {
756  outStr << "<status";
758  {
759  outStr << " numberOfSubstatuses=\"";
761  outStr << "\"";
762  }
763  if(m_OSResult->optimization->solution[i]->status->type.length() > 0)
764  {
765  outStr << " type=\"";
766  outStr << m_OSResult->optimization->solution[i]->status->type;
767  outStr << "\"";
768  }
769  if(m_OSResult->optimization->solution[i]->status->description.length() > 0)
770  {
771  outStr << " description=";
773  }
774  outStr << ">" << endl;
775  for (int j=0; j < m_OSResult->optimization->solution[i]->status->numberOfSubstatuses; j++)
776  {
777  outStr << "<substatus";
778  if(m_OSResult->optimization->solution[i]->status->substatus[j]->type.length() > 0)
779  {
780  outStr << " type=\"";
781  outStr << m_OSResult->optimization->solution[i]->status->substatus[j]->type;
782  outStr << "\"";
783  }
784  if(m_OSResult->optimization->solution[i]->status->substatus[j]->description.length() > 0)
785  {
786  outStr << " description=";
788  }
789  outStr << "/>" << endl;
790  }
791  outStr << "</status>" << endl;
792  }
793 
794  if(m_OSResult->optimization->solution[i]->message != "")
795  {
796  outStr << "<message>";
797  outStr << m_OSResult->optimization->solution[i]->message;
798  outStr << "</message>" << endl;
799  }
800  if(m_OSResult->optimization->solution[i]->variables != NULL)
801  {
802  outStr << "<variables ";
804  outStr << "numberOfOtherVariableResults=\"" << m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults << "\"";
805  outStr << ">" << endl;
806  if(m_OSResult->optimization->solution[i]->variables->values != NULL)
807  {
808 #ifndef NDEBUG
810  "output <variables> <values>");
811 #endif
812  outStr << "<values numberOfVar=\"" << m_OSResult->optimization->solution[i]->variables->values->numberOfVar << "\">" << endl;
813  for(j = 0; j < m_OSResult->optimization->solution[i]->variables->values->numberOfVar; j++)
814  {
815  if(m_OSResult->optimization->solution[i]->variables->values->var[j] != NULL)
816  {
817  outStr << "<var";
818  outStr << " idx=\"";
819  outStr << m_OSResult->optimization->solution[i]->variables->values->var[j]->idx;
820  outStr << "\"";
821  if (m_OSResult->optimization->solution[i]->variables->values->var[j]->name != "")
822  outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->values->var[j]->name);
823  outStr << ">";
825  outStr << "</var>" << endl;
826  }
827  }
828  outStr << "</values>" << endl;
829  }
830 
832  {
833 #ifndef NDEBUG
835  "output <variables> <valuesString>");
836 #endif
837  outStr << "<valuesString numberOfVar=\"" << m_OSResult->optimization->solution[i]->variables->valuesString->numberOfVar << "\">" << endl;
839  {
841  {
842  outStr << "<var";
843  outStr << " idx=\"";
845  outStr << "\"";
847  outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->name);
848  outStr << ">";
850  outStr << "</var>" << endl;
851  }
852  }
853  outStr << "</valuesString>" << endl;
854  }
855 
857  {
858 #ifndef NDEBUG
860  "output <variables> <basisStatus>");
861 #endif
862  outStr << "<basisStatus>" << endl;
864  outStr << "</basisStatus>" << endl;
865  }
866 
867 #ifndef NDEBUG
868  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <variables> <other>");
869 #endif
870  if(m_OSResult->optimization->solution[i]->variables->other != NULL)
871  {
873  {
875  {
876  outStr << "<other";
878  {
879  outStr << " numberOfVar=\"";
881  outStr << "\"" ;
882  }
884  {
885  outStr << " numberOfEnumerations=\"";
887  outStr << "\"" ;
888  }
889  outStr << " name=";
891  if (m_OSResult->optimization->solution[i]->variables->other[k]->value != "")
892  {
893  outStr << " value=\"";
894  outStr << m_OSResult->optimization->solution[i]->variables->other[k]->value;
895  outStr << "\"" ;
896  }
897  if (m_OSResult->optimization->solution[i]->variables->other[k]->type != "")
898  {
899  outStr << " type=\"";
900  outStr << m_OSResult->optimization->solution[i]->variables->other[k]->type;
901  outStr << "\"" ;
902  }
904  {
905  outStr << " description=";
907  }
908  if (m_OSResult->optimization->solution[i]->variables->other[k]->varType != "")
909  {
910  outStr << " varType=\"";
911  outStr << m_OSResult->optimization->solution[i]->variables->other[k]->varType;
912  outStr << "\"" ;
913  }
915  {
916  outStr << " enumType=\"";
918  outStr << "\"" ;
919  }
920  outStr << ">" << endl;
922  {
923  for(j = 0; j < m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar; j++)
924  {
925  outStr << "<var";
926  outStr << " idx=\"";
927  outStr << m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->idx ;
928  outStr << "\"";
929  if (m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->name != "")
930  outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->name);
931  outStr << ">";
932  outStr << m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->value;
933  outStr << "</var>" << endl;
934  }
935  }
937  {
938  for(j = 0; j < m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations; j++)
939  {
942  }
943  }
944  outStr << "</other>" << endl;
945  }
946  }
947  } // end of if on other variables
948  outStr << "</variables>" << endl;
949  }
950  if(m_OSResult->optimization->solution[i]->objectives != NULL)
951  {
952  outStr << "<objectives ";
954  outStr << "numberOfOtherObjectiveResults=\"" << m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults << "\"";
955  outStr << ">" << endl;
956 #ifndef NDEBUG
958  "output <objectives> <values>");
959 #endif
961  {
962  outStr << "<values numberOfObj=\"" << m_OSResult->optimization->solution[i]->objectives->values->numberOfObj << "\">" << endl;
963  for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->values->numberOfObj; j++)
964  {
965  if(m_OSResult->optimization->solution[i]->objectives->values->obj[j] != NULL)
966  {
967  outStr << "<obj";
968  outStr << " idx=\"";
969  outStr << m_OSResult->optimization->solution[i]->objectives->values->obj[j]->idx; //-(1 + j) ;
970  outStr << "\"";
971  if (m_OSResult->optimization->solution[i]->objectives->values->obj[j]->name != "")
972  outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->objectives->values->obj[j]->name);
973  outStr << ">";
975  outStr << "</obj>" << endl;
976  }
977  }
978 
979  outStr << "</values>" << endl;
980  }
981 
983  {
984 #ifndef NDEBUG
986  "output <objectives> <basisStatus>");
987 #endif
988  outStr << "<basisStatus>" << endl;
990  outStr << "</basisStatus>" << endl;
991  }
992 
993 #ifndef NDEBUG
995  "output <objectives> <other>");
996 #endif
997  if(m_OSResult->optimization->solution[i]->objectives->other != NULL)
998  {
1000  {
1002  {
1003  outStr << "<other" ;
1005  {
1006  outStr << " numberOfObj=\"";
1008  outStr << "\"" ;
1009  }
1011  {
1012  outStr << " numberOfEnumerations=\"";
1014  outStr << "\"" ;
1015  }
1016  if (m_OSResult->optimization->solution[i]->objectives->other[k]->name != "")
1017  {
1018  outStr << " name=";
1019  \
1021  };
1022  if (m_OSResult->optimization->solution[i]->objectives->other[k]->value != "")
1023  {
1024  outStr << " value=\"";
1025  \
1026  outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->value;
1027  outStr << "\"" ;
1028  };
1029  if (m_OSResult->optimization->solution[i]->objectives->other[k]->type != "")
1030  {
1031  outStr << " type=\"";
1032  outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->type;
1033  outStr << "\"" ;
1034  }
1036  {
1037  outStr << " description=";
1039  };
1040  if (m_OSResult->optimization->solution[i]->objectives->other[k]->objType != "")
1041  {
1042  outStr << " objType=\"";
1043  outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->objType;
1044  outStr << "\"" ;
1045  }
1047  {
1048  outStr << " enumType=\"";
1050  outStr << "\"" ;
1051  }
1052  outStr << ">" << endl;
1054  {
1055  for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj; j++)
1056  {
1057  outStr << "<obj";
1058  outStr << " idx=\"";
1059  outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->idx;
1060  outStr << "\"";
1061  if (m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->name != "")
1062  outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->name);
1063  outStr << ">";
1064  outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->value;
1065  outStr << "</obj>" << endl;
1066  }
1067  }
1069  {
1070  for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations; j++)
1071  {
1074  }
1075  }
1076  outStr << "</other>" << endl;
1077  }
1078  }
1079  } // end of if on other objectives
1080  outStr << "</objectives>" << endl;
1081  }
1082 
1083  if(m_OSResult->optimization->solution[i]->constraints != NULL)
1084  {
1085  outStr << "<constraints ";
1087  outStr << "numberOfOtherConstraintResults=\"" << m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults << "\"";
1088  outStr << ">" << endl;
1089 #ifndef NDEBUG
1091  "output <constraints> <dualValues>");
1092 #endif
1094  {
1095  outStr << "<dualValues numberOfCon=\"" << m_OSResult->optimization->solution[i]->constraints->dualValues->numberOfCon << "\">" << endl;
1096  for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->dualValues->numberOfCon; j++)
1097  {
1098  if(m_OSResult->optimization->solution[i]->constraints->dualValues->con[j] != NULL)
1099  {
1100  outStr << "<con";
1101  outStr << " idx=\"";
1103  outStr << "\"";
1105  outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->name);
1106  outStr << ">";
1108  outStr << "</con>" << endl;
1109  }
1110  }
1111  outStr << "</dualValues>" << endl;
1112  }
1113 
1115  {
1116 #ifndef NDEBUG
1118  "output <constraints> <basisStatus>");
1119 #endif
1120  outStr << "<basisStatus>" << endl;
1122  outStr << "</basisStatus>" << endl;
1123  }
1124 
1125 #ifndef NDEBUG
1127  "output <constraints> <other>");
1128 #endif
1129  if(m_OSResult->optimization->solution[i]->constraints->other != NULL)
1130  {
1132  {
1134  {
1135  outStr << "<other";
1137  {
1138  outStr << " numberOfCon=\"";
1140  outStr << "\"";
1141  }
1143  {
1144  outStr << " numberOfEnumerations=\"";
1146  outStr << "\"";
1147  }
1148  outStr << " name=";
1149  \
1151  if (m_OSResult->optimization->solution[i]->constraints->other[k]->value != "")
1152  {
1153  outStr << " value=\"";
1154  \
1155  outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->value;
1156  outStr << "\"" ;
1157  };
1158  if (m_OSResult->optimization->solution[i]->constraints->other[k]->type != "")
1159  {
1160  outStr << " type=\"";
1161  outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->type;
1162  outStr << "\"" ;
1163 
1164  }
1166  {
1167  outStr << " description=";
1169  };
1171  {
1172  outStr << " conType=\"";
1174  outStr << "\"" ;
1175  }
1177  {
1178  outStr << " enumType=\"";
1180  outStr << "\"" ;
1181  }
1182  outStr << ">" << endl;
1184  {
1185  for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon; j++)
1186  {
1187  outStr << "<con";
1188  outStr << " idx=\"";
1189  outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->idx;
1190  outStr << "\"";
1191  if (m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->name != "")
1192  outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->name);
1193  outStr << ">";
1194  outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->value;
1195  outStr << "</con>" << endl;
1196  }
1197  }
1199  {
1200  for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations; j++)
1201  {
1204  }
1205  }
1206  outStr << "</other>" << endl;
1207  }
1208  }
1209  } // end of if on other constraints
1210  outStr << "</constraints>" << endl;
1211  }// end of <constraints> element
1212 
1214  {
1215 #ifndef NDEBUG
1217  "output <matrixProgramming>");
1218 #endif
1219  outStr << "<matrixProgramming";
1222  outStr << " numberOfOtherMatrixProgrammingResults=\""
1225  outStr << ">" << endl;
1226 
1228  {
1229  MatrixVariableSolution* tmpVar
1231 #ifndef NDEBUG
1233  "output <matrixVariables>");
1234 #endif
1235  outStr << "<matrixVariables";
1236  if (tmpVar->numberOfOtherMatrixVariableResults > 0)
1237  outStr << " numberOfOtherMatrixVariableResults=\""
1238  << tmpVar->numberOfOtherMatrixVariableResults << "\"";
1239  outStr << ">" << endl;
1240 
1241  if (tmpVar->values != NULL)
1242  {
1243  outStr << "<values numberOfMatrixVar=\""
1244  << tmpVar->values->numberOfMatrixVar << "\">" << std::endl;
1245  for (int var=0; var < tmpVar->values->numberOfMatrixVar; var++)
1246  outStr << tmpVar->values->matrixVar[var]->getMatrixNodeInXML();
1247  }
1248  outStr << "</values>" << endl;
1249  if (tmpVar->numberOfOtherMatrixVariableResults > 0 &&
1250  tmpVar->other != NULL)
1251  {
1252  for (int j=0; j < tmpVar->numberOfOtherMatrixVariableResults; j++)
1253  {
1254  outStr << "<other name=\"" << tmpVar->other[j]->name << "\"";
1255  if (tmpVar->other[j]->description != "")
1256  outStr << " description=\"" << tmpVar->other[j]->description << "\"";
1257  if (tmpVar->other[j]->value != "")
1258  outStr << " value=\"" << tmpVar->other[j]->value << "\"";
1259  if (tmpVar->other[j]->type != "")
1260  outStr << " type=\"" << tmpVar->other[j]->type << "\"";
1261  if (tmpVar->other[j]->solver != "")
1262  outStr << " solver=\"" << tmpVar->other[j]->solver << "\"";
1263  if (tmpVar->other[j]->category != "")
1264  outStr << " category=\"" << tmpVar->other[j]->category << "\"";
1265  if (tmpVar->other[j]->numberOfMatrixVar != 0)
1266  outStr << " numberOfMatrixVar=\""
1267  << tmpVar->other[j]->numberOfMatrixVar << "\"";
1268  if (tmpVar->other[j]->matrixType != "")
1269  outStr << " matrixType=\"" << tmpVar->other[j]->matrixType << "\"";
1270  if (tmpVar->other[j]->numberOfEnumerations != 0)
1271  outStr << " numberOfEnumerations=\""
1272  << tmpVar->other[j]->numberOfEnumerations << "\"";
1273  if (tmpVar->other[j]->enumType != "")
1274  outStr << " enumType=\"" << tmpVar->other[j]->enumType << "\"";
1275 
1276  if (tmpVar->other[j]->numberOfMatrixVar == 0 &&
1277  tmpVar->other[j]->numberOfEnumerations == 0)
1278  {
1279  outStr << "/>" << endl;
1280  }
1281  else
1282  {
1283  outStr << ">" << endl;
1284  if (tmpVar->other[j]->numberOfMatrixVar > 0)
1285  for (int var=0; var < tmpVar->other[j]->numberOfMatrixVar; var++)
1286  outStr << tmpVar->other[j]->matrixVar[var]->getMatrixNodeInXML();
1287 
1288  if (tmpVar->other[j]->numberOfEnumerations > 0)
1289  for(int k = 0; k < tmpVar->other[j]->numberOfEnumerations; k++)
1290  {
1292  tmpVar->other[j]->enumeration[j],
1294  }
1295 
1296  outStr << "</other>" << endl;
1297  }
1298  }
1299  }
1300  outStr << "</matrixVariables>" << endl;
1301  }
1302  outStr << "</matrixProgramming>" << endl;
1303  }
1304 
1305 #ifndef NDEBUG
1306  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <otherSolutionResults>");
1307 #endif
1309  {
1310  outStr << "<otherSolutionResults numberOfOtherSolutionResults=\"";
1312  outStr << "\">" << std::endl;
1314  {
1315  outStr << "<otherSolutionResult";
1316  outStr << " name=";
1318  outStr << " value=";
1320  outStr << " numberOfItems=\"";
1322  outStr << "\"";
1324  outStr << " category=\"" << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->category << "\"";
1327  outStr << ">" << std::endl;
1329  outStr << "<item>" << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->item[j] << "</item>" << std::endl;
1330  outStr << "</otherSolutionResult>" << std::endl;
1331  }
1332  outStr << "</otherSolutionResults>" << std::endl;
1333  }
1334  outStr << "</solution>" << endl;
1335  } // end if solution not NULL
1336  } // end for loop(i=0..numberOfSolutions)
1337 
1338 
1339 #ifndef NDEBUG
1340  osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <otherSolverOutput>");
1341 #endif
1343 // if (m_OSResult->optimization->otherSolverOutput->numberOfSolverOutputs > 0)
1344  {
1345  outStr << "<otherSolverOutput numberOfSolverOutputs=\"";
1347  outStr << "\">" << std::endl;
1349  {
1350  outStr << "<solverOutput";
1351  outStr << " name=\"";
1353  outStr << "\"";
1354  outStr << " numberOfItems=\"";
1356  outStr << "\"";
1358  outStr << " category=\"" << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->category << "\"";
1361  outStr << ">" << std::endl;
1362  for(int j = 0; j < m_OSResult->optimization->otherSolverOutput->solverOutput[k]->numberOfItems; j++)
1363  {
1364  outStr << "<item>" << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->item[j] << "</item>" << std::endl;
1365  }
1366  outStr << "</solverOutput>" << std::endl;
1367  }
1368  outStr << "</otherSolverOutput>" << std::endl;
1369  }
1370 
1371  outStr << "</optimization>" << endl;
1372  } // end if (optimization != NULL)
1373  outStr << "</osrl>" << endl ;
1374 #ifndef NDEBUG
1376 #endif
1377  return outStr.str();
1378 }// end writeOSrL
1379 
1380 
const OSSmartPtr< OSOutput > osoutput
Definition: OSOutput.cpp:39
std::string os_dtoa_format(double x)
Definition: OSMathUtil.cpp:154
std::string writeStringData(std::string str)
writeStringData
std::string writeGeneralFileHeader(GeneralFileHeader *v, bool addWhiteSpace)
Take a GeneralFileHeader object and write a string that validates against the OSgL schema.
Definition: OSgLWriter.cpp:36
std::string writeOtherOptionOrResultEnumeration(OtherOptionOrResultEnumeration *e, bool addWhiteSpace, bool writeBase64)
Take an OtherOptionOrResultEnumeration object and write a string that validates against the OSgL sche...
Definition: OSgLWriter.cpp:81
std::string writeBasisStatus(BasisStatus *bs, bool addWhiteSpace, bool writeBase64)
Take a BasisStatus object and write a string that validates against the OSgL schema.
Definition: OSgLWriter.cpp:190
std::string description
additional description about the CPU
Definition: OSGeneral.h:876
int value
the number of CPUs
Definition: OSGeneral.h:879
std::string description
additional description about the CPU speed
Definition: OSGeneral.h:820
std::string unit
the unit in which CPU speed is measured
Definition: OSGeneral.h:817
double value
the CPU speed (expressed in multiples of unit)
Definition: OSGeneral.h:823
OtherConstraintResult ** other
a pointer to an array of other pointer objects for constraint functions
Definition: OSResult.h:1879
BasisStatus * basisStatus
a pointer to a BasisStatus object
Definition: OSResult.h:1874
DualVariableValues * dualValues
a pointer to an array of DualVariableValues objects
Definition: OSResult.h:1871
int numberOfOtherConstraintResults
the number of types of constraint function results other than the basic constraint function values
Definition: OSResult.h:1868
std::string name
optional name
Definition: OSResult.h:1606
double value
value of dual variable on the constraint indexed by idx
Definition: OSResult.h:1611
int idx
idx is the index on a constraint
Definition: OSResult.h:1603
DualVarValue ** con
con is a vector of DualVarValue objects that give an index and dual variable value for each constrain...
Definition: OSResult.h:1666
int numberOfCon
record the number of constraints for which values are given
Definition: OSResult.h:1660
std::string fileCreator
name(s) of author(s) who created this file
Definition: OSGeneral.h:55
std::string source
used when the file or problem appeared in the literature (could be in BiBTeX format or similar)
Definition: OSGeneral.h:45
std::string name
used to give a name to the file or the problem contained within it
Definition: OSGeneral.h:39
std::string description
further information about the file or the problem contained within it
Definition: OSGeneral.h:50
std::string licence
licensing information if applicable
Definition: OSGeneral.h:60
std::string solverInvoked
the name of the solver used
Definition: OSResult.h:299
std::string serviceURI
the serviceURI is the URI of the solver service that did the optimization
Definition: OSResult.h:281
std::string serviceName
the serviceName is the name of the solver service that did the optimization
Definition: OSResult.h:286
std::string timeStamp
a time stamp associated with the process
Definition: OSResult.h:303
std::string jobID
the jobID is the ID associated with the solution of this instance
Definition: OSResult.h:295
OtherResults * otherResults
a pointer to the OtherResults class
Definition: OSResult.h:307
GeneralStatus * generalStatus
a pointer to the GeneralStatus class
Definition: OSResult.h:272
std::string instanceName
the name of the instance that was solved
Definition: OSResult.h:290
std::string message
any general message associated with the optimization
Definition: OSResult.h:276
int numberOfSubstatuses
the number of substatuses
Definition: OSResult.h:111
std::string type
the type of status
Definition: OSResult.h:114
GeneralSubstatus ** substatus
the array of substatuses
Definition: OSResult.h:120
std::string description
the description of the status
Definition: OSResult.h:117
std::string description
the description of the substatus
Definition: OSResult.h:63
std::string name
the name of the substatus
Definition: OSResult.h:60
std::string status
job status
Definition: OSResult.h:664
std::string scheduledStartTime
the time when the job was supposed to start
Definition: OSResult.h:670
TimingInformation * timingInformation
a pointer to the TimingInformation class
Definition: OSResult.h:679
CPUSpeed * usedCPUSpeed
a pointer to the CPUSpeed class
Definition: OSResult.h:692
CPUNumber * usedCPUNumber
a pointer to the CPUNumber class
Definition: OSResult.h:696
StorageCapacity * usedMemory
a pointer to the MemorySize class
Definition: OSResult.h:688
std::string submitTime
time the job was submitted
Definition: OSResult.h:667
std::string actualStartTime
the time when the job actually started
Definition: OSResult.h:673
StorageCapacity * usedDiskSpace
a pointer to the DiskSpace class
Definition: OSResult.h:683
OtherResults * otherResults
a pointer to the OtherResults class
Definition: OSResult.h:700
std::string endTime
the time when the job finished
Definition: OSResult.h:676
MatrixVariableSolution * matrixVariables
a pointer to the matrixVariables object
Definition: OSResult.h:2085
int numberOfOtherMatrixProgrammingResults
the number of <other> child elements>
Definition: OSResult.h:2079
The in-memory representation of the <MatrixVariableSolution> element.
Definition: OSResult.h:1993
MatrixVariableValues * values
values is pointer to the <values> child
Definition: OSResult.h:1999
int numberOfOtherMatrixVariableResults
numberOfOtherMatrixVariableResults gives the number of <other> children
Definition: OSResult.h:1996
OtherMatrixVariableResult ** other
other is a pointer to an array of <other> children
Definition: OSResult.h:2002
OSMatrixWithMatrixVarIdx ** matrixVar
matrixVar is an array of pointers to the <matrixVar> children
Definition: OSResult.h:1921
int numberOfMatrixVar
numberOfMatrixVar gives the number of <matrixVar> children
Definition: OSResult.h:1918
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:3771
The Result Class.
Definition: OSResult.h:2549
GeneralResult * general
general holds the first child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2561
ServiceResult * service
service holds the third child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2571
OptimizationResult * optimization
optimization holds the fifth child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2581
GeneralFileHeader * resultHeader
header information
Definition: OSResult.h:2556
SystemResult * system
system holds the second child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2566
JobResult * job
job holds the fourth child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2576
std::string writeOSrL(OSResult *theosresult)
create an osrl string from an OSResult object
Definition: OSrLWriter.cpp:45
bool m_bWhiteSpace
m_bWhiteSpace is set to true if we write white space in the file
Definition: OSrLWriter.h:69
OSResult * m_OSResult
m_OSResult is an object in the class OSResult, the data in m_OSResult are written to a string that va...
Definition: OSrLWriter.h:37
~OSrLWriter()
Class destructor.
Definition: OSrLWriter.cpp:40
bool m_bWriteBase64
m_bWriteBase64 is set to true if we encode the linear constraint coefficients in base64 binary
Definition: OSrLWriter.h:65
OSrLWriter()
Default constructor.
Definition: OSrLWriter.cpp:34
double value
the value of the objective indexed by idx
Definition: OSResult.h:1292
int idx
idx is the index on an objective function
Definition: OSResult.h:1286
std::string name
optional name
Definition: OSResult.h:1289
OtherObjectiveResult ** other
a pointer to an array of other pointer objects for objective functions
Definition: OSResult.h:1555
int numberOfOtherObjectiveResults
the number of types of objective function results other than the basic objective function values
Definition: OSResult.h:1544
BasisStatus * basisStatus
a pointer to a BasisStatus object
Definition: OSResult.h:1550
ObjectiveValues * values
a pointer to an array of ObjectiveValues objects
Definition: OSResult.h:1547
int numberOfObj
record the number of objective rows for which values are given
Definition: OSResult.h:1338
ObjValue ** obj
obj is a pointer to an array of ObjValue objects that give an index and objective function value for ...
Definition: OSResult.h:1344
int numberOfSolutions
numberOfSolutions is the number of objective functions reported.
Definition: OSResult.h:2480
OtherSolverOutput * otherSolverOutput
otherSolverOutput is a pointer to an OtherSolverOutput object
Definition: OSResult.h:2505
int numberOfObjectives
numberOfObjectives is the number of objective functions reported in the solution.
Definition: OSResult.h:2490
int numberOfVariables
numberOfVariables is the number of variables reported in the solution.
Definition: OSResult.h:2485
OptimizationSolution ** solution
solution is an array of pointers to OptimizationSolution objects
Definition: OSResult.h:2500
int numberOfConstraints
numberOfConstrants is the number of constraint functions reported in the solution.
Definition: OSResult.h:2495
VariableSolution * variables
variables holds the solution information for the variables
Definition: OSResult.h:2291
ObjectiveSolution * objectives
objectives holds the solution information for the objectives
Definition: OSResult.h:2300
MatrixProgrammingSolution * matrixProgramming
matrixProgramming holds the solution information for the matrix programming components: matrix variab...
Definition: OSResult.h:2306
bool weightedObjectives
a marker to track whether the objectives are weighted
Definition: OSResult.h:2278
int targetObjectiveIdx
the index of the objective function for which we are reporting solution information
Definition: OSResult.h:2270
OtherSolutionResults * otherSolutionResults
otherSolutionResults is a pointer to an OtherSolutionResults object that is associated with this opti...
Definition: OSResult.h:2311
std::string targetObjectiveName
an optional name of the objective function for which we are reporting solution information
Definition: OSResult.h:2275
ConstraintSolution * constraints
constraints holds the solution information for the constraints
Definition: OSResult.h:2295
OptimizationSolutionStatus * status
status is a pointer to an OptimizationSolutionStatus object associated with this optimization solutio...
Definition: OSResult.h:2283
std::string message
a message associated with this solution
Definition: OSResult.h:2286
int numberOfSubstatuses
the number of substatus objects
Definition: OSResult.h:797
OptimizationSolutionSubstatus ** substatus
a pointer to an array of substatus objects
Definition: OSResult.h:806
std::string description
a description of the solution status type
Definition: OSResult.h:803
std::string type
the type of solution status
Definition: OSResult.h:800
std::string description
a description of the solution substatus
Definition: OSResult.h:751
std::string type
the type of the solution substatus
Definition: OSResult.h:748
int idx
idx is the index on the constraint
Definition: OSResult.h:1714
std::string name
optional name
Definition: OSResult.h:1717
std::string value
value is a value associated with the constraint indexed by idx, for example value might be the value ...
Definition: OSResult.h:1724
OtherConResult ** con
Definition: OSResult.h:1805
std::string conType
type of the values in the con array
Definition: OSResult.h:1808
int numberOfEnumerations
the number of distinct values for this particular type of result
Definition: OSResult.h:1779
std::string description
a brief description of the type of result
Definition: OSResult.h:1793
std::string enumType
type of the values in the enumeration array
Definition: OSResult.h:1817
int numberOfCon
the number of constraints which have values for this particular type of result
Definition: OSResult.h:1774
std::string name
the name of the result the user is defining
Definition: OSResult.h:1782
OtherOptionOrResultEnumeration ** enumeration
Definition: OSResult.h:1814
std::string type
type of the result value (integer, double, boolean, string)
Definition: OSResult.h:1790
std::string value
this element allows a specific value associated with this particular type of result
Definition: OSResult.h:1787
std::string matrixType
the type of matrixVar
Definition: OSResult.h:1956
OtherOptionOrResultEnumeration ** enumeration
the enumeration.
Definition: OSResult.h:1970
int numberOfEnumerations
number of levels in an enumeration associated with this result
Definition: OSResult.h:1962
std::string enumType
the type of the enumeration
Definition: OSResult.h:1965
std::string name
Gives a name to this result.
Definition: OSResult.h:1943
OSMatrixWithMatrixVarIdx ** matrixVar
the list of matrices and their values
Definition: OSResult.h:1959
int numberOfMatrixVar
number of matrix variables affected by or associated with this result
Definition: OSResult.h:1953
std::string description
other data elements are optional
Definition: OSResult.h:1946
std::string value
value is a value associated with an objective function indexed by idx
Definition: OSResult.h:1400
int idx
idx is the index on a objective function
Definition: OSResult.h:1392
std::string name
optional name
Definition: OSResult.h:1395
std::string value
this element allows a specific value associated with this particular type of result
Definition: OSResult.h:1463
std::string objType
type of the values in the obj array
Definition: OSResult.h:1484
int numberOfEnumerations
the number of distinct values for this particular type of result
Definition: OSResult.h:1455
std::string description
a brief description of the type of result
Definition: OSResult.h:1469
std::string enumType
type of the values in the enumeration array
Definition: OSResult.h:1493
OtherOptionOrResultEnumeration ** enumeration
Definition: OSResult.h:1490
int numberOfObj
the number of objectives which have values for this particular type of result
Definition: OSResult.h:1450
OtherObjResult ** obj
Definition: OSResult.h:1481
std::string type
type of the result value (integer, double, boolean, string)
Definition: OSResult.h:1466
std::string name
the name of the result the user is defining
Definition: OSResult.h:1458
std::string name
the name of the other result
Definition: OSResult.h:168
std::string description
the description of the other result
Definition: OSResult.h:174
std::string value
the value of the other result
Definition: OSResult.h:171
int numberOfOtherResults
the number of other results
Definition: OSResult.h:222
OtherResult ** other
the array of other results
Definition: OSResult.h:225
std::string name
the name of the result the user is defining
Definition: OSResult.h:2141
std::string * item
an array of items (string-valued)
Definition: OSResult.h:2160
std::string description
a brief description of the type of result
Definition: OSResult.h:2152
std::string value
the value associated with the result the user is defining
Definition: OSResult.h:2144
std::string category
this element allows a specific category to be associated with this particular type of result
Definition: OSResult.h:2149
int numberOfItems
the number of items contained in this otherSolutionResult
Definition: OSResult.h:2156
int numberOfOtherSolutionResults
the number of elements in the pointer of OtherSolutionResult objects
Definition: OSResult.h:2210
OtherSolutionResult ** otherSolutionResult
otherSolutionResult is a pointer to an array of OtherSolutionResult objects
Definition: OSResult.h:2215
SolverOutput ** solverOutput
solverOutput is a pointer to an array of SolverOutput objects
Definition: OSResult.h:2429
int numberOfSolverOutputs
the number of elements in the pointer of SolverOutput objects
Definition: OSResult.h:2425
std::string value
value holds a general value associated with a variable, for example, rather than the value of a varia...
Definition: OSResult.h:1081
int idx
the index of a variable in the solution
Definition: OSResult.h:1070
std::string name
optional name
Definition: OSResult.h:1073
int numberOfEnumerations
the number of distinct values for this particular type of result
Definition: OSResult.h:1136
std::string value
this element allows a specific value associated with this particular type of result
Definition: OSResult.h:1144
std::string varType
type of the values in the var array
Definition: OSResult.h:1165
std::string enumType
type of the values in the enumeration array
Definition: OSResult.h:1174
std::string type
type of the result value (integer, double, boolean, string)
Definition: OSResult.h:1147
std::string description
a brief description of the type of result
Definition: OSResult.h:1150
OtherOptionOrResultEnumeration ** enumeration
Definition: OSResult.h:1171
std::string name
the name of the result the user is defining
Definition: OSResult.h:1139
OtherVarResult ** var
Definition: OSResult.h:1162
int numberOfVar
the number of variables which have values for this particular type of result
Definition: OSResult.h:1131
double serviceUtilization
service utilization
Definition: OSResult.h:432
int totalJobsSoFar
total jobs processed so far
Definition: OSResult.h:426
int currentJobCount
the number of jobs currently running
Definition: OSResult.h:423
OtherResults * otherResults
a pointer to the OtherResults class
Definition: OSResult.h:436
std::string currentState
a string describing the current state of the service
Definition: OSResult.h:420
std::string timeServiceStarted
the time when the service was started
Definition: OSResult.h:429
int numberOfItems
the number of items contained in this otherSolutionResult
Definition: OSResult.h:2371
std::string category
this element allows a specific category to be associated with this particular type of result
Definition: OSResult.h:2364
std::string name
the name of the result the user is defining
Definition: OSResult.h:2359
std::string * item
an array of items (string-valued)
Definition: OSResult.h:2375
std::string description
a brief description of the type of result
Definition: OSResult.h:2367
std::string unit
the unit in which storage capacity is measured
Definition: OSGeneral.h:759
double value
the number of units of storage capacity
Definition: OSGeneral.h:765
std::string description
additional description about the storage
Definition: OSGeneral.h:762
OtherResults * otherResults
a pointer to the OtherResults class
Definition: OSResult.h:374
std::string systemInformation
a string containing some basic system information
Definition: OSResult.h:354
StorageCapacity * availableMemory
a pointer to the MemorySize class
Definition: OSResult.h:362
CPUNumber * availableCPUNumber
a pointer to the CPUNumber class
Definition: OSResult.h:370
StorageCapacity * availableDiskSpace
a pointer to the DiskSpace class
Definition: OSResult.h:358
CPUSpeed * availableCPUSpeed
a pointer to the CPUSpeed class
Definition: OSResult.h:366
std::string category
The category of time (total/input/preprocessing/optimization/postprocessing/output/other)
Definition: OSResult.h:558
std::string description
Further description on the timer used.
Definition: OSResult.h:563
std::string type
The type of timer used (cpuTime/elapsedTime/other)
Definition: OSResult.h:553
std::string unit
the unit in which time is measured
Definition: OSGeneral.h:929
double value
the number of units
Definition: OSGeneral.h:932
TimeMeasurement ** time
An array of time measurements.
Definition: OSResult.h:618
int numberOfTimes
The number of elements in the time array.
Definition: OSResult.h:612
int idx
idx is the index on variable in the solution
Definition: OSResult.h:852
double value
Definition: OSResult.h:860
std::string name
optional name
Definition: OSResult.h:855
std::string name
optional name
Definition: OSResult.h:964
std::string value
Definition: OSResult.h:969
int idx
idx is the index on variable in the solution
Definition: OSResult.h:961
OtherVariableResult ** other
a pointer to an array of other pointer objects for variables
Definition: OSResult.h:1238
BasisStatus * basisStatus
a pointer to a BasisStatus object
Definition: OSResult.h:1233
int numberOfOtherVariableResults
the number of types of variable results other than the value of the variable
Definition: OSResult.h:1224
VariableValues * values
a pointer to a VariableValues object
Definition: OSResult.h:1227
VariableValuesString * valuesString
a pointer to a VariableValuesString object
Definition: OSResult.h:1230
VarValue ** var
a vector of VarValue objects, there will be one for each variable in the solution
Definition: OSResult.h:912
int numberOfVar
the number of variable values that are in the solution
Definition: OSResult.h:907
VarValueString ** var
a vector of VarValueString objects, there will be one for each variable in the solution
Definition: OSResult.h:1022
int numberOfVar
the number of string-valued variable values that are in the solution
Definition: OSResult.h:1017
#define OS_SCHEMA_VERSION
Definition: OSParameters.h:83
@ ENUM_OUTPUT_LEVEL_trace
Definition: OSParameters.h:115
@ ENUM_OUTPUT_AREA_OSrLwriter
Definition: OSParameters.h:143