00001
00017 #include "OSrLWriter.h"
00018 #include "OSResult.h"
00019 #include "OSgLWriter.h"
00020 #include "OSGeneral.h"
00021 #include "OSStringUtil.h"
00022 #include "OSParameters.h"
00023 #include "OSConfig.h"
00024 #include "OSOutput.h"
00025 #include "OSBase64.h"
00026 #include "OSMathUtil.h"
00027 #include <sstream>
00028 #include <iostream>
00029 #include <stdio.h>
00030
00031 using std::endl;
00032 using std::ostringstream;
00033
00034 OSrLWriter::OSrLWriter( )
00035 {
00036 m_bWriteBase64 = false;
00037 m_bWhiteSpace = false;
00038 }
00039
00040 OSrLWriter::~OSrLWriter()
00041 {
00042 }
00043
00044
00045 std::string OSrLWriter::writeOSrL( OSResult *theosresult)
00046 {
00047 m_OSResult = theosresult;
00048 std::ostringstream outStr;
00049 #ifdef WIN_
00050 const char dirsep='\\';
00051 #else
00052 const char dirsep='/';
00053 #endif
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 int i, j;
00067 bool generalTagPrinted;
00068 bool systemTagPrinted;
00069 bool serviceTagPrinted;
00070 bool jobTagPrinted;
00071 #ifndef NDEBUG
00072 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "in OSrLWriter");
00073 #endif
00074
00075 if(m_OSResult == NULL) return outStr.str();
00076 outStr << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ;
00077 outStr << "<?xml-stylesheet type=\"text/xsl\" href=\"";
00078
00079 outStr << "OSrL.xslt\"?>";
00080 outStr << endl;
00081 outStr << "<osrl xmlns=\"os.optimizationservices.org\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ";
00082 outStr << "xsi:schemaLocation=\"os.optimizationservices.org http://www.optimizationservices.org/schemas/";
00083 outStr << OS_SCHEMA_VERSION;
00084 outStr << "/OSrL.xsd\" >" ;
00085 outStr << endl;
00086
00087 #ifndef NDEBUG
00088 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <resultHeader>");
00089 #endif
00090 if(m_OSResult->resultHeader != NULL)
00091 {
00092 if (m_OSResult->resultHeader->name != "" ||
00093 m_OSResult->resultHeader->source != "" ||
00094 m_OSResult->resultHeader->description != "" ||
00095 m_OSResult->resultHeader->fileCreator != "" ||
00096 m_OSResult->resultHeader->licence != "" )
00097 {
00098 outStr << "<resultHeader>" << endl;
00099 outStr << writeGeneralFileHeader(m_OSResult->resultHeader, true);
00100 outStr << "</resultHeader>" << endl;
00101 }
00102 }
00103
00104
00105 #ifndef NDEBUG
00106 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <general>");
00107 #endif
00108 if(m_OSResult->general != NULL)
00109 {
00110 generalTagPrinted = false;
00111 if(m_OSResult->general->generalStatus != NULL)
00112 {
00113 if (generalTagPrinted == false)
00114 {
00115 outStr << "<general>" << endl;
00116 generalTagPrinted = true;
00117 }
00118 outStr << "<generalStatus";
00119 if(m_OSResult->general->generalStatus->type.length() > 0)
00120 {
00121 outStr << " type=\"";
00122 outStr << m_OSResult->general->generalStatus->type ;
00123 outStr << "\"";
00124 }
00125 if(m_OSResult->general->generalStatus->description.length() > 0)
00126 {
00127 outStr << " description=";
00128 outStr << writeStringData(m_OSResult->general->generalStatus->description);
00129 }
00130 if (m_OSResult->general->generalStatus->numberOfSubstatuses > 0)
00131 {
00132 outStr << " numberOfSubstatuses=\"";
00133 outStr << m_OSResult->general->generalStatus->numberOfSubstatuses;
00134 outStr << "\"";
00135 }
00136 outStr << ">" << endl;
00137 for (int i=0; i < m_OSResult->general->generalStatus->numberOfSubstatuses; i++)
00138 {
00139 outStr << "<substatus";
00140 if (m_OSResult->general->generalStatus->substatus[i]->name.length() > 0)
00141 {
00142 outStr << " name=\"";
00143 outStr << m_OSResult->general->generalStatus->substatus[i]->name ;
00144 outStr << "\"";
00145 }
00146 if (m_OSResult->general->generalStatus->substatus[i]->description.length() > 0)
00147 {
00148 outStr << " description=\"";
00149 outStr << m_OSResult->general->generalStatus->substatus[i]->description ;
00150 outStr << "\"";
00151 }
00152 outStr << "/>" << endl;
00153 }
00154 outStr << "</generalStatus>" << endl;
00155 }
00156
00157 if(m_OSResult->general->message.length() > 0)
00158 {
00159 if (generalTagPrinted == false)
00160 {
00161 outStr << "<general>" << endl;
00162 generalTagPrinted = true;
00163 }
00164 outStr << "<message>" + m_OSResult->general->message + "</message>" << endl;
00165 }
00166 if(m_OSResult->general->serviceURI.length() > 0)
00167 {
00168 if (generalTagPrinted == false)
00169 {
00170 outStr << "<general>" << endl;
00171 generalTagPrinted = true;
00172 }
00173 outStr << "<serviceURI>" + m_OSResult->general->serviceURI + "</serviceURI>" << endl;
00174 }
00175 if(m_OSResult->general->serviceName.length() > 0)
00176 {
00177 if (generalTagPrinted == false)
00178 {
00179 outStr << "<general>" << endl;
00180 generalTagPrinted = true;
00181 }
00182 outStr << "<serviceName>" + m_OSResult->general->serviceName + "</serviceName>" << endl;
00183 }
00184 if(m_OSResult->general->instanceName.length() > 0)
00185 {
00186 if (generalTagPrinted == false)
00187 {
00188 outStr << "<general>" << endl;
00189 generalTagPrinted = true;
00190 }
00191 outStr << "<instanceName>" + m_OSResult->general->instanceName + "</instanceName>" << endl;
00192 }
00193 if(m_OSResult->general->jobID.length() > 0)
00194 {
00195 if (generalTagPrinted == false)
00196 {
00197 outStr << "<general>" << endl;
00198 generalTagPrinted = true;
00199 }
00200 outStr << "<jobID>" + m_OSResult->general->jobID + "</jobID>" << endl;
00201 }
00202 if(m_OSResult->general->solverInvoked.length() > 0)
00203 {
00204 if (generalTagPrinted == false)
00205 {
00206 outStr << "<general>" << endl;
00207 generalTagPrinted = true;
00208 }
00209 outStr << "<solverInvoked>" + m_OSResult->general->solverInvoked + "</solverInvoked>" << endl;
00210 }
00211 if(m_OSResult->general->timeStamp.length() > 0)
00212 {
00213 if (generalTagPrinted == false)
00214 {
00215 outStr << "<general>" << endl;
00216 generalTagPrinted = true;
00217 }
00218 outStr << "<timeStamp>" + m_OSResult->general->timeStamp + "</timeStamp>" << endl;
00219 }
00220
00221 if(m_OSResult->general->otherResults != NULL)
00222 {
00223 if(m_OSResult->general->otherResults->numberOfOtherResults > 0)
00224 {
00225 if (generalTagPrinted == false)
00226 {
00227 outStr << "<general>" << endl;
00228 generalTagPrinted = true;
00229 }
00230 outStr << "<otherResults numberOfOtherResults=\"";
00231 outStr << m_OSResult->general->otherResults->numberOfOtherResults;
00232 outStr << "\">" << endl;
00233 for (int i=0; i < m_OSResult->general->otherResults->numberOfOtherResults; i++)
00234 {
00235 outStr << "<other";
00236 if (m_OSResult->general->otherResults->other[i]->name.length() > 0)
00237 {
00238 outStr << " name=";
00239 outStr << writeStringData(m_OSResult->general->otherResults->other[i]->name);
00240 }
00241 if (m_OSResult->general->otherResults->other[i]->value.length() > 0)
00242 {
00243 outStr << " value=";
00244 outStr << writeStringData(m_OSResult->general->otherResults->other[i]->value);
00245 }
00246 if (m_OSResult->general->otherResults->other[i]->description.length() > 0)
00247 {
00248 outStr << " description=";
00249 outStr << writeStringData(m_OSResult->general->otherResults->other[i]->description);
00250 }
00251 outStr << " />" << endl;
00252 }
00253 outStr << "</otherResults>" << endl;;
00254 }
00255 }
00256 if (generalTagPrinted == true)
00257 outStr << "</general>" << endl;
00258 }
00259
00260
00261 #ifndef NDEBUG
00262 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <system>");
00263 #endif
00264 if(m_OSResult->system != NULL)
00265 {
00266 systemTagPrinted = false;
00267 if(m_OSResult->system->systemInformation.length() > 0)
00268 {
00269 if (systemTagPrinted == false)
00270 {
00271 outStr << "<system>" << endl;
00272 systemTagPrinted = true;
00273 }
00274 outStr << "<systemInformation>" + m_OSResult->system->systemInformation + "</systemInformation>" << endl;
00275 }
00276
00277 if(m_OSResult->system->availableDiskSpace != NULL)
00278 {
00279 if (systemTagPrinted == false)
00280 {
00281 outStr << "<system>" << endl;
00282 systemTagPrinted = true;
00283 }
00284 outStr << "<availableDiskSpace";
00285 if(m_OSResult->system->availableDiskSpace->unit.length() > 0)
00286 {
00287 outStr << " unit=\"";
00288 outStr << m_OSResult->system->availableDiskSpace->unit;
00289 outStr << "\"";
00290 }
00291 if(m_OSResult->system->availableDiskSpace->description.length() > 0)
00292 {
00293 outStr << " description=";
00294 outStr << writeStringData(m_OSResult->system->availableDiskSpace->description);
00295 }
00296 outStr << ">";
00297 outStr << os_dtoa_format(m_OSResult->system->availableDiskSpace->value);
00298 outStr << "</availableDiskSpace>" << endl;
00299 }
00300
00301 if(m_OSResult->system->availableMemory != NULL)
00302 {
00303 if (systemTagPrinted == false)
00304 {
00305 outStr << "<system>" << endl;
00306 systemTagPrinted = true;
00307 }
00308 outStr << "<availableMemory";
00309 if(m_OSResult->system->availableMemory->unit.length() > 0)
00310 {
00311 outStr << " unit=\"";
00312 outStr << m_OSResult->system->availableMemory->unit;
00313 outStr << "\"";
00314 }
00315 if(m_OSResult->system->availableMemory->description.length() > 0)
00316 {
00317 outStr << " description=";
00318 outStr << writeStringData(m_OSResult->system->availableMemory->description);
00319 }
00320 outStr << ">";
00321 outStr << os_dtoa_format(m_OSResult->system->availableMemory->value);
00322 outStr << "</availableMemory>" << endl;
00323 }
00324
00325 if(m_OSResult->system->availableCPUSpeed != NULL)
00326 {
00327 if (systemTagPrinted == false)
00328 {
00329 outStr << "<system>" << endl;
00330 systemTagPrinted = true;
00331 }
00332 outStr << "<availableCPUSpeed";
00333 if(m_OSResult->system->availableCPUSpeed->unit.length() > 0)
00334 {
00335 outStr << " unit=\"";
00336 outStr << m_OSResult->system->availableCPUSpeed->unit ;
00337 outStr << "\"";
00338 }
00339 if(m_OSResult->system->availableCPUSpeed->description.length() > 0)
00340 {
00341 outStr << " description=";
00342 outStr << writeStringData(m_OSResult->system->availableCPUSpeed->description);
00343 }
00344 outStr << ">";
00345 outStr << os_dtoa_format(m_OSResult->system->availableCPUSpeed->value);
00346 outStr << "</availableCPUSpeed>" << endl;
00347 }
00348
00349 if(m_OSResult->system->availableCPUNumber != NULL)
00350 {
00351 if (systemTagPrinted == false)
00352 {
00353 outStr << "<system>" << endl;
00354 systemTagPrinted = true;
00355 }
00356 outStr << "<availableCPUNumber";
00357 if(m_OSResult->system->availableCPUNumber->description.length() > 0)
00358 {
00359 outStr << " description=";
00360 outStr << writeStringData(m_OSResult->system->availableCPUNumber->description);
00361 }
00362 outStr << ">";
00363 outStr << m_OSResult->system->availableCPUNumber->value;
00364 outStr << "</availableCPUNumber>" << endl;
00365 }
00366
00367 if(m_OSResult->system->otherResults != NULL)
00368 {
00369 if(m_OSResult->system->otherResults->numberOfOtherResults > 0)
00370 {
00371 if (systemTagPrinted == false)
00372 {
00373 outStr << "<system>" << endl;
00374 systemTagPrinted = true;
00375 }
00376 outStr << "<otherResults numberOfOtherResults=\"";
00377 outStr << m_OSResult->system->otherResults->numberOfOtherResults;
00378 outStr << "\">" << endl;
00379 for (int i=0; i < m_OSResult->system->otherResults->numberOfOtherResults; i++)
00380 {
00381 outStr << "<other";
00382 if (m_OSResult->system->otherResults->other[i]->name.length() > 0)
00383 {
00384 outStr << " name=";
00385 outStr << writeStringData(m_OSResult->system->otherResults->other[i]->name);
00386 }
00387 if (m_OSResult->system->otherResults->other[i]->value.length() > 0)
00388 {
00389 outStr << " value=";
00390 outStr << writeStringData(m_OSResult->system->otherResults->other[i]->value);
00391 }
00392 if (m_OSResult->system->otherResults->other[i]->description.length() > 0)
00393 {
00394 outStr << " description=";
00395 outStr << writeStringData(m_OSResult->system->otherResults->other[i]->description);
00396 }
00397 outStr << " />" << endl;
00398 }
00399 outStr << "</otherResults>" << endl;
00400 }
00401 }
00402 if (systemTagPrinted == true)
00403 outStr << "</system>" << endl;
00404 }
00405
00406
00407 #ifndef NDEBUG
00408 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <service>");
00409 #endif
00410 if(m_OSResult->service != NULL)
00411 {
00412 serviceTagPrinted = false;
00413 if(m_OSResult->service->currentState.length() > 0 && m_OSResult->service->currentState != "unknown")
00414 {
00415 if (serviceTagPrinted == false)
00416 {
00417 outStr << "<service>" << endl;
00418 serviceTagPrinted = true;
00419 }
00420 outStr << "<currentState>" << m_OSResult->service->currentState << "</currentState>" << endl;
00421 }
00422 if(m_OSResult->service->currentJobCount >= 0)
00423 {
00424 if (serviceTagPrinted == false)
00425 {
00426 outStr << "<service>" << endl;
00427 serviceTagPrinted = true;
00428 }
00429 outStr << "<currentJobCount>" << m_OSResult->service->currentJobCount << "</currentJobCount>" << endl;
00430 }
00431 if(m_OSResult->service->totalJobsSoFar >= 0)
00432 {
00433 if (serviceTagPrinted == false)
00434 {
00435 outStr << "<service>" << endl;
00436 serviceTagPrinted = true;
00437 }
00438 outStr << "<totalJobsSoFar>" << m_OSResult->service->totalJobsSoFar << "</totalJobsSoFar>" << endl;
00439 }
00440 if(m_OSResult->service->timeServiceStarted.length() > 0 && m_OSResult->service->timeServiceStarted != "1970-01-01T00:00:00-00:00")
00441 {
00442 if (serviceTagPrinted == false)
00443 {
00444 outStr << "<service>" << endl;
00445 serviceTagPrinted = true;
00446 }
00447 outStr << "<timeServiceStarted>" << m_OSResult->service->timeServiceStarted << "</timeServiceStarted>" << endl;
00448 }
00449 if(m_OSResult->service->serviceUtilization != -1.0)
00450 {
00451 if (serviceTagPrinted == false)
00452 {
00453 outStr << "<service>" << endl;
00454 serviceTagPrinted = true;
00455 }
00456 outStr << "<serviceUtilization>" << os_dtoa_format(m_OSResult->service->serviceUtilization) << "</serviceUtilization>" << endl;
00457 }
00458
00459 if(m_OSResult->service->otherResults != NULL)
00460 {
00461 if(m_OSResult->service->otherResults->numberOfOtherResults > 0)
00462 {
00463 if (serviceTagPrinted == false)
00464 {
00465 outStr << "<service>" << endl;
00466 serviceTagPrinted = true;
00467 }
00468 outStr << "<otherResults numberOfOtherResults=\"";
00469 outStr << m_OSResult->service->otherResults->numberOfOtherResults;
00470 outStr << "\">" << endl;
00471 for (int i=0; i < m_OSResult->service->otherResults->numberOfOtherResults; i++)
00472 {
00473 outStr << "<other";
00474 if (m_OSResult->service->otherResults->other[i]->name.length() > 0)
00475 {
00476 outStr << " name=";
00477 outStr << writeStringData(m_OSResult->service->otherResults->other[i]->name);
00478 }
00479 if (m_OSResult->service->otherResults->other[i]->value.length() > 0)
00480 {
00481 outStr << " value=";
00482 outStr << writeStringData(m_OSResult->service->otherResults->other[i]->value);
00483 }
00484 if (m_OSResult->service->otherResults->other[i]->description.length() > 0)
00485 {
00486 outStr << " description=";
00487 outStr << writeStringData(m_OSResult->service->otherResults->other[i]->description);
00488 }
00489 outStr << " />" << endl;
00490 }
00491 outStr << "</otherResults>" << endl;
00492 }
00493 }
00494 if (serviceTagPrinted == true)
00495 outStr << "</service>" << endl;
00496 }
00497
00498
00499 #ifndef NDEBUG
00500 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <job>");
00501 #endif
00502 if(m_OSResult->job != NULL)
00503 {
00504 jobTagPrinted = false;
00505
00506 if(m_OSResult->job->status.length() > 0 && m_OSResult->job->status != "finished")
00507 {
00508 if (jobTagPrinted == false)
00509 {
00510 outStr << "<job>" << endl;
00511 jobTagPrinted = true;
00512 }
00513 outStr << "<status>" + m_OSResult->job->status + "</status>" << endl;
00514 }
00515 if(m_OSResult->job->submitTime.length() > 0 && m_OSResult->job->submitTime != "1970-01-01T00:00:00-00:00")
00516 {
00517 if (jobTagPrinted == false)
00518 {
00519 outStr << "<job>" << endl;
00520 jobTagPrinted = true;
00521 }
00522 outStr << "<submitTime>" + m_OSResult->job->submitTime + "</submitTime>" << endl;
00523 }
00524 if(m_OSResult->job->scheduledStartTime.length() > 0 && m_OSResult->job->scheduledStartTime != "1970-01-01T00:00:00-00:00")
00525 {
00526 if (jobTagPrinted == false)
00527 {
00528 outStr << "<job>" << endl;
00529 jobTagPrinted = true;
00530 }
00531 outStr << "<scheduledStartTime>" + m_OSResult->job->scheduledStartTime + "</scheduledStartTime>" << endl;
00532 }
00533 if(m_OSResult->job->actualStartTime.length() > 0 && m_OSResult->job->actualStartTime != "1970-01-01T00:00:00-00:00")
00534 {
00535 if (jobTagPrinted == false)
00536 {
00537 outStr << "<job>" << endl;
00538 jobTagPrinted = true;
00539 }
00540 outStr << "<actualStartTime>" + m_OSResult->job->actualStartTime + "</actualStartTime>" << endl;
00541 }
00542 if(m_OSResult->job->endTime.length() > 0 && m_OSResult->job->endTime != "1970-01-01T00:00:00-00:00")
00543 {
00544 if (jobTagPrinted == false)
00545 {
00546 outStr << "<job>" << endl;
00547 jobTagPrinted = true;
00548 }
00549 outStr << "<endTime>" + m_OSResult->job->endTime + "</endTime>" << endl;
00550 }
00551
00552 if (m_OSResult->job->timingInformation != NULL)
00553 {
00554 if (jobTagPrinted == false)
00555 {
00556 outStr << "<job>" << endl;
00557 jobTagPrinted = true;
00558 }
00559 outStr << "<timingInformation numberOfTimes=\"";
00560 outStr << m_OSResult->job->timingInformation->numberOfTimes << "\">" << endl;
00561 for (i=0; i<m_OSResult->job->timingInformation->numberOfTimes; i++)
00562 {
00563 outStr << "<time";
00564 if (m_OSResult->job->timingInformation->time[i]->type != "")
00565 outStr << " type=\"" << m_OSResult->job->timingInformation->time[i]->type << "\"";
00566 if (m_OSResult->job->timingInformation->time[i]->unit != "")
00567 outStr << " unit=\"" << m_OSResult->job->timingInformation->time[i]->unit << "\"";
00568 if (m_OSResult->job->timingInformation->time[i]->category != "")
00569 outStr << " category=\"" << m_OSResult->job->timingInformation->time[i]->category << "\"";
00570 if (m_OSResult->job->timingInformation->time[i]->description != "")
00571 outStr << " description=" << writeStringData(m_OSResult->job->timingInformation->time[i]->description);
00572 outStr << ">" << endl;
00573 outStr << os_dtoa_format(m_OSResult->job->timingInformation->time[i]->value);
00574 outStr << "</time>" << endl;
00575 }
00576 outStr << "</timingInformation>" << endl;
00577 }
00578
00579 if(m_OSResult->job->usedDiskSpace != NULL)
00580 {
00581 if (jobTagPrinted == false)
00582 {
00583 outStr << "<job>" << endl;
00584 jobTagPrinted = true;
00585 }
00586 outStr << "<usedDiskSpace";
00587 if(m_OSResult->job->usedDiskSpace->unit.length() > 0)
00588 {
00589 outStr << " unit=\"";
00590 outStr << m_OSResult->job->usedDiskSpace->unit ;
00591 outStr << "\"";
00592 }
00593 if(m_OSResult->job->usedDiskSpace->description.length() > 0)
00594 {
00595 outStr << " description=";
00596 outStr << writeStringData(m_OSResult->job->usedDiskSpace->description);
00597 }
00598 outStr << ">";
00599 outStr << os_dtoa_format(m_OSResult->job->usedDiskSpace->value);
00600 outStr << "</usedDiskSpace>" << endl;
00601 }
00602
00603 if(m_OSResult->job->usedMemory != NULL)
00604 {
00605 if (jobTagPrinted == false)
00606 {
00607 outStr << "<job>" << endl;
00608 jobTagPrinted = true;
00609 }
00610 outStr << "<usedMemory";
00611 if(m_OSResult->job->usedMemory->unit.length() > 0)
00612 {
00613 outStr << " unit=\"";
00614 outStr << m_OSResult->job->usedMemory->unit ;
00615 outStr << "\"";
00616 }
00617 if(m_OSResult->job->usedMemory->description.length() > 0)
00618 {
00619 outStr << " description=";
00620 outStr << writeStringData(m_OSResult->job->usedMemory->description);
00621 }
00622 outStr << ">";
00623 outStr << os_dtoa_format(m_OSResult->job->usedMemory->value);
00624 outStr << "</usedMemory>" << endl;
00625 }
00626
00627 if(m_OSResult->job->usedCPUSpeed != NULL)
00628 {
00629 if (jobTagPrinted == false)
00630 {
00631 outStr << "<job>" << endl;
00632 jobTagPrinted = true;
00633 }
00634 outStr << "<usedCPUSpeed";
00635 if(m_OSResult->job->usedCPUSpeed->unit.length() > 0)
00636 {
00637 outStr << " unit=\"";
00638 outStr << m_OSResult->job->usedCPUSpeed->unit ;
00639 outStr << "\"";
00640 }
00641 if(m_OSResult->job->usedCPUSpeed->description.length() > 0)
00642 {
00643 outStr << " description=";
00644 outStr << writeStringData(m_OSResult->job->usedCPUSpeed->description);
00645 }
00646 outStr << ">";
00647 outStr << os_dtoa_format(m_OSResult->job->usedCPUSpeed->value);
00648 outStr << "</usedCPUSpeed>" << endl;
00649 }
00650
00651 if(m_OSResult->job->usedCPUNumber != NULL)
00652 {
00653 if (jobTagPrinted == false)
00654 {
00655 outStr << "<job>" << endl;
00656 jobTagPrinted = true;
00657 }
00658 outStr << "<usedCPUNumber";
00659 if(m_OSResult->job->usedCPUNumber->description.length() > 0)
00660 {
00661 outStr << " description=";
00662 outStr << writeStringData(m_OSResult->job->usedCPUNumber->description);
00663 }
00664 outStr << ">";
00665 outStr << m_OSResult->job->usedCPUNumber->value;
00666 outStr << "</usedCPUNumber>" << endl;
00667 }
00668
00669 if(m_OSResult->job->otherResults != NULL)
00670 {
00671 if(m_OSResult->job->otherResults->numberOfOtherResults > 0)
00672 {
00673 if (jobTagPrinted == false)
00674 {
00675 outStr << "<job>" << endl;
00676 jobTagPrinted = true;
00677 }
00678 outStr << "<otherResults numberOfOtherResults=\"";
00679 outStr << m_OSResult->job->otherResults->numberOfOtherResults;
00680 outStr << "\">" << endl;
00681 for (int i=0; i < m_OSResult->job->otherResults->numberOfOtherResults; i++)
00682 {
00683 outStr << "<other";
00684 if (m_OSResult->job->otherResults->other[i]->name.length() > 0)
00685 {
00686 outStr << " name=";
00687 outStr << writeStringData(m_OSResult->job->otherResults->other[i]->name);
00688 }
00689 if (m_OSResult->job->otherResults->other[i]->value.length() > 0)
00690 {
00691 outStr << " value=";
00692 outStr << writeStringData(m_OSResult->job->otherResults->other[i]->value);
00693 }
00694 if (m_OSResult->job->otherResults->other[i]->description.length() > 0)
00695 {
00696 outStr << " description=";
00697 outStr << writeStringData(m_OSResult->job->otherResults->other[i]->description);
00698 }
00699 outStr << " />" << endl;
00700 }
00701 outStr << "</otherResults>" << endl;
00702 }
00703 }
00704 if (jobTagPrinted == true)
00705 outStr << "</job>" << endl;
00706 }
00707
00708
00709 #ifndef NDEBUG
00710 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <optimization>");
00711 #endif
00712 if(m_OSResult->optimization != NULL)
00713 {
00714 outStr << "<optimization " ;
00715 outStr << "numberOfSolutions=\"";
00716 outStr << m_OSResult->optimization->numberOfSolutions ;
00717 outStr << "\"";
00718 if (m_OSResult->optimization->numberOfVariables >= 0)
00719 {
00720 outStr << " numberOfVariables=\"";
00721 outStr << m_OSResult->optimization->numberOfVariables ;
00722 outStr << "\"";
00723 }
00724 if (m_OSResult->optimization->numberOfConstraints >= 0)
00725 {
00726 outStr << " numberOfConstraints=\"";
00727 outStr << m_OSResult->optimization->numberOfConstraints ;
00728 outStr << "\"";
00729 }
00730 if (m_OSResult->optimization->numberOfObjectives >= 0)
00731 {
00732 outStr << " numberOfObjectives=\"";
00733 outStr << m_OSResult->optimization->numberOfObjectives ;
00734 outStr << "\"" ;
00735 }
00736 outStr << ">" << endl;
00737
00738 for(i = 0; i < m_OSResult->optimization->numberOfSolutions; i++)
00739 {
00740 if(m_OSResult->optimization->solution[i] != NULL)
00741 {
00742 outStr << "<solution" ;
00743 outStr << " targetObjectiveIdx=\"";
00744 outStr << m_OSResult->optimization->solution[i]->targetObjectiveIdx ;
00745 outStr << "\"" ;
00746 if (m_OSResult->optimization->solution[i]->targetObjectiveName.length() > 0)
00747 {
00748 outStr << " targetObjectiveName=";
00749 outStr << writeStringData(m_OSResult->optimization->solution[i]->targetObjectiveName);
00750 }
00751 if (m_OSResult->optimization->solution[i]->weightedObjectives)
00752 outStr << " weightedObjectives=\"true\"";
00753 outStr << ">" << endl;
00754 if(m_OSResult->optimization->solution[i]->status != NULL)
00755 {
00756 outStr << "<status";
00757 if (m_OSResult->optimization->solution[i]->status->numberOfSubstatuses > 0)
00758 {
00759 outStr << " numberOfSubstatuses=\"";
00760 outStr << m_OSResult->optimization->solution[i]->status->numberOfSubstatuses ;
00761 outStr << "\"";
00762 }
00763 if(m_OSResult->optimization->solution[i]->status->type.length() > 0)
00764 {
00765 outStr << " type=\"";
00766 outStr << m_OSResult->optimization->solution[i]->status->type;
00767 outStr << "\"";
00768 }
00769 if(m_OSResult->optimization->solution[i]->status->description.length() > 0)
00770 {
00771 outStr << " description=";
00772 outStr << writeStringData(m_OSResult->optimization->solution[i]->status->description);
00773 }
00774 outStr << ">" << endl;
00775 for (int j=0; j < m_OSResult->optimization->solution[i]->status->numberOfSubstatuses; j++)
00776 {
00777 outStr << "<substatus";
00778 if(m_OSResult->optimization->solution[i]->status->substatus[j]->type.length() > 0)
00779 {
00780 outStr << " type=\"";
00781 outStr << m_OSResult->optimization->solution[i]->status->substatus[j]->type;
00782 outStr << "\"";
00783 }
00784 if(m_OSResult->optimization->solution[i]->status->substatus[j]->description.length() > 0)
00785 {
00786 outStr << " description=";
00787 outStr << writeStringData(m_OSResult->optimization->solution[i]->status->substatus[j]->description);
00788 }
00789 outStr << "/>" << endl;
00790 }
00791 outStr << "</status>" << endl;
00792 }
00793
00794 if(m_OSResult->optimization->solution[i]->message != "")
00795 {
00796 outStr << "<message>";
00797 outStr << m_OSResult->optimization->solution[i]->message;
00798 outStr << "</message>" << endl;
00799 }
00800 if(m_OSResult->optimization->solution[i]->variables != NULL)
00801 {
00802 outStr << "<variables ";
00803 if (m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults > 0)
00804 outStr << "numberOfOtherVariableResults=\"" << m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults << "\"";
00805 outStr << ">" << endl;
00806 if(m_OSResult->optimization->solution[i]->variables->values != NULL)
00807 {
00808 #ifndef NDEBUG
00809 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
00810 "output <variables> <values>");
00811 #endif
00812 outStr << "<values numberOfVar=\"" << m_OSResult->optimization->solution[i]->variables->values->numberOfVar << "\">" << endl;
00813 for(j = 0; j < m_OSResult->optimization->solution[i]->variables->values->numberOfVar; j++)
00814 {
00815 if(m_OSResult->optimization->solution[i]->variables->values->var[j] != NULL)
00816 {
00817 outStr << "<var";
00818 outStr << " idx=\"";
00819 outStr << m_OSResult->optimization->solution[i]->variables->values->var[j]->idx;
00820 outStr << "\"";
00821 if (m_OSResult->optimization->solution[i]->variables->values->var[j]->name != "")
00822 outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->values->var[j]->name);
00823 outStr << ">";
00824 outStr << os_dtoa_format( m_OSResult->optimization->solution[i]->variables->values->var[j]->value );
00825 outStr << "</var>" << endl;
00826 }
00827 }
00828 outStr << "</values>" << endl;
00829 }
00830
00831 if(m_OSResult->optimization->solution[i]->variables->valuesString != NULL)
00832 {
00833 #ifndef NDEBUG
00834 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
00835 "output <variables> <valuesString>");
00836 #endif
00837 outStr << "<valuesString numberOfVar=\"" << m_OSResult->optimization->solution[i]->variables->valuesString->numberOfVar << "\">" << endl;
00838 for(j = 0; j < m_OSResult->optimization->solution[i]->variables->valuesString->numberOfVar; j++)
00839 {
00840 if(m_OSResult->optimization->solution[i]->variables->valuesString->var[j] != NULL)
00841 {
00842 outStr << "<var";
00843 outStr << " idx=\"";
00844 outStr << m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->idx;
00845 outStr << "\"";
00846 if (m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->name != "")
00847 outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->name);
00848 outStr << ">";
00849 outStr << m_OSResult->optimization->solution[i]->variables->valuesString->var[j]->value;
00850 outStr << "</var>" << endl;
00851 }
00852 }
00853 outStr << "</valuesString>" << endl;
00854 }
00855
00856 if(m_OSResult->optimization->solution[i]->variables->basisStatus != NULL)
00857 {
00858 #ifndef NDEBUG
00859 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
00860 "output <variables> <basisStatus>");
00861 #endif
00862 outStr << "<basisStatus>" << endl;
00863 outStr << writeBasisStatus(m_OSResult->optimization->solution[i]->variables->basisStatus, m_bWhiteSpace, m_bWriteBase64);
00864 outStr << "</basisStatus>" << endl;
00865 }
00866
00867 #ifndef NDEBUG
00868 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <variables> <other>");
00869 #endif
00870 if(m_OSResult->optimization->solution[i]->variables->other != NULL)
00871 {
00872 if(m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults > 0)
00873 {
00874 for(int k = 0; k < m_OSResult->optimization->solution[i]->variables->numberOfOtherVariableResults; k++)
00875 {
00876 outStr << "<other";
00877 if (m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar > 0)
00878 {
00879 outStr << " numberOfVar=\"";
00880 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar;
00881 outStr << "\"" ;
00882 }
00883 else if(m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations > 0)
00884 {
00885 outStr << " numberOfEnumerations=\"";
00886 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations;
00887 outStr << "\"" ;
00888 }
00889 outStr << " name=";
00890 outStr << writeStringData(m_OSResult->optimization->solution[i]->variables->other[k]->name);
00891 if (m_OSResult->optimization->solution[i]->variables->other[k]->value != "")
00892 {
00893 outStr << " value=\"";
00894 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->value;
00895 outStr << "\"" ;
00896 }
00897 if (m_OSResult->optimization->solution[i]->variables->other[k]->type != "")
00898 {
00899 outStr << " type=\"";
00900 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->type;
00901 outStr << "\"" ;
00902 }
00903 if (m_OSResult->optimization->solution[i]->variables->other[k]->description != "")
00904 {
00905 outStr << " description=";
00906 outStr << writeStringData(m_OSResult->optimization->solution[i]->variables->other[k]->description);
00907 }
00908 if (m_OSResult->optimization->solution[i]->variables->other[k]->varType != "")
00909 {
00910 outStr << " varType=\"";
00911 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->varType;
00912 outStr << "\"" ;
00913 }
00914 if (m_OSResult->optimization->solution[i]->variables->other[k]->enumType != "")
00915 {
00916 outStr << " enumType=\"";
00917 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->enumType;
00918 outStr << "\"" ;
00919 }
00920 outStr << ">" << endl;
00921 if(m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar > 0)
00922 {
00923 for(j = 0; j < m_OSResult->optimization->solution[i]->variables->other[k]->numberOfVar; j++)
00924 {
00925 outStr << "<var";
00926 outStr << " idx=\"";
00927 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->idx ;
00928 outStr << "\"";
00929 if (m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->name != "")
00930 outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->name);
00931 outStr << ">";
00932 outStr << m_OSResult->optimization->solution[i]->variables->other[k]->var[j]->value;
00933 outStr << "</var>" << endl;
00934 }
00935 }
00936 else if (m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations > 0)
00937 {
00938 for(j = 0; j < m_OSResult->optimization->solution[i]->variables->other[k]->numberOfEnumerations; j++)
00939 {
00940 outStr << writeOtherOptionOrResultEnumeration(m_OSResult->optimization->solution[i]->variables->other[k]->enumeration[j],
00941 m_bWhiteSpace, m_bWriteBase64);
00942 }
00943 }
00944 outStr << "</other>" << endl;
00945 }
00946 }
00947 }
00948 outStr << "</variables>" << endl;
00949 }
00950 if(m_OSResult->optimization->solution[i]->objectives != NULL)
00951 {
00952 outStr << "<objectives ";
00953 if (m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults > 0)
00954 outStr << "numberOfOtherObjectiveResults=\"" << m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults << "\"";
00955 outStr << ">" << endl;
00956 #ifndef NDEBUG
00957 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
00958 "output <objectives> <values>");
00959 #endif
00960 if(m_OSResult->optimization->solution[i]->objectives->values != NULL)
00961 {
00962 outStr << "<values numberOfObj=\"" << m_OSResult->optimization->solution[i]->objectives->values->numberOfObj << "\">" << endl;
00963 for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->values->numberOfObj; j++)
00964 {
00965 if(m_OSResult->optimization->solution[i]->objectives->values->obj[j] != NULL)
00966 {
00967 outStr << "<obj";
00968 outStr << " idx=\"";
00969 outStr << m_OSResult->optimization->solution[i]->objectives->values->obj[j]->idx;
00970 outStr << "\"";
00971 if (m_OSResult->optimization->solution[i]->objectives->values->obj[j]->name != "")
00972 outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->objectives->values->obj[j]->name);
00973 outStr << ">";
00974 outStr << os_dtoa_format( m_OSResult->optimization->solution[i]->objectives->values->obj[j]->value);
00975 outStr << "</obj>" << endl;
00976 }
00977 }
00978
00979 outStr << "</values>" << endl;
00980 }
00981
00982 if(m_OSResult->optimization->solution[i]->objectives->basisStatus != NULL)
00983 {
00984 #ifndef NDEBUG
00985 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
00986 "output <objectives> <basisStatus>");
00987 #endif
00988 outStr << "<basisStatus>" << endl;
00989 outStr << writeBasisStatus(m_OSResult->optimization->solution[i]->objectives->basisStatus, m_bWhiteSpace, m_bWriteBase64);
00990 outStr << "</basisStatus>" << endl;
00991 }
00992
00993 #ifndef NDEBUG
00994 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
00995 "output <objectives> <other>");
00996 #endif
00997 if(m_OSResult->optimization->solution[i]->objectives->other != NULL)
00998 {
00999 if(m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults > 0)
01000 {
01001 for(int k = 0; k < m_OSResult->optimization->solution[i]->objectives->numberOfOtherObjectiveResults; k++)
01002 {
01003 outStr << "<other" ;
01004 if (m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj > 0)
01005 {
01006 outStr << " numberOfObj=\"";
01007 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj;
01008 outStr << "\"" ;
01009 }
01010 else if(m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations > 0)
01011 {
01012 outStr << " numberOfEnumerations=\"";
01013 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations;
01014 outStr << "\"" ;
01015 }
01016 if (m_OSResult->optimization->solution[i]->objectives->other[k]->name != "")
01017 {
01018 outStr << " name=";
01019 \
01020 outStr << writeStringData(m_OSResult->optimization->solution[i]->objectives->other[k]->name);
01021 };
01022 if (m_OSResult->optimization->solution[i]->objectives->other[k]->value != "")
01023 {
01024 outStr << " value=\"";
01025 \
01026 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->value;
01027 outStr << "\"" ;
01028 };
01029 if (m_OSResult->optimization->solution[i]->objectives->other[k]->type != "")
01030 {
01031 outStr << " type=\"";
01032 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->type;
01033 outStr << "\"" ;
01034 }
01035 if (m_OSResult->optimization->solution[i]->objectives->other[k]->description != "")
01036 {
01037 outStr << " description=";
01038 outStr << writeStringData(m_OSResult->optimization->solution[i]->objectives->other[k]->description);
01039 };
01040 if (m_OSResult->optimization->solution[i]->objectives->other[k]->objType != "")
01041 {
01042 outStr << " objType=\"";
01043 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->objType;
01044 outStr << "\"" ;
01045 }
01046 if (m_OSResult->optimization->solution[i]->objectives->other[k]->enumType != "")
01047 {
01048 outStr << " enumType=\"";
01049 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->enumType;
01050 outStr << "\"" ;
01051 }
01052 outStr << ">" << endl;
01053 if(m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj > 0)
01054 {
01055 for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfObj; j++)
01056 {
01057 outStr << "<obj";
01058 outStr << " idx=\"";
01059 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->idx;
01060 outStr << "\"";
01061 if (m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->name != "")
01062 outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->name);
01063 outStr << ">";
01064 outStr << m_OSResult->optimization->solution[i]->objectives->other[k]->obj[j]->value;
01065 outStr << "</obj>" << endl;
01066 }
01067 }
01068 else if (m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations > 0)
01069 {
01070 for(j = 0; j < m_OSResult->optimization->solution[i]->objectives->other[k]->numberOfEnumerations; j++)
01071 {
01072 outStr << writeOtherOptionOrResultEnumeration(m_OSResult->optimization->solution[i]->objectives->other[k]->enumeration[j],
01073 m_bWhiteSpace, m_bWriteBase64);
01074 }
01075 }
01076 outStr << "</other>" << endl;
01077 }
01078 }
01079 }
01080 outStr << "</objectives>" << endl;
01081 }
01082
01083 if(m_OSResult->optimization->solution[i]->constraints != NULL)
01084 {
01085 outStr << "<constraints ";
01086 if (m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults > 0)
01087 outStr << "numberOfOtherConstraintResults=\"" << m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults << "\"";
01088 outStr << ">" << endl;
01089 #ifndef NDEBUG
01090 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
01091 "output <constraints> <dualValues>");
01092 #endif
01093 if(m_OSResult->optimization->solution[i]->constraints->dualValues != NULL)
01094 {
01095 outStr << "<dualValues numberOfCon=\"" << m_OSResult->optimization->solution[i]->constraints->dualValues->numberOfCon << "\">" << endl;
01096 for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->dualValues->numberOfCon; j++)
01097 {
01098 if(m_OSResult->optimization->solution[i]->constraints->dualValues->con[j] != NULL)
01099 {
01100 outStr << "<con";
01101 outStr << " idx=\"";
01102 outStr << m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->idx;
01103 outStr << "\"";
01104 if (m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->name != "")
01105 outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->name);
01106 outStr << ">";
01107 outStr << os_dtoa_format( m_OSResult->optimization->solution[i]->constraints->dualValues->con[j]->value);
01108 outStr << "</con>" << endl;
01109 }
01110 }
01111 outStr << "</dualValues>" << endl;
01112 }
01113
01114 if(m_OSResult->optimization->solution[i]->constraints->basisStatus != NULL)
01115 {
01116 #ifndef NDEBUG
01117 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
01118 "output <constraints> <basisStatus>");
01119 #endif
01120 outStr << "<basisStatus>" << endl;
01121 outStr << writeBasisStatus(m_OSResult->optimization->solution[i]->constraints->basisStatus, m_bWhiteSpace, m_bWriteBase64);
01122 outStr << "</basisStatus>" << endl;
01123 }
01124
01125 #ifndef NDEBUG
01126 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
01127 "output <constraints> <other>");
01128 #endif
01129 if(m_OSResult->optimization->solution[i]->constraints->other != NULL)
01130 {
01131 if(m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults > 0)
01132 {
01133 for(int k = 0; k < m_OSResult->optimization->solution[i]->constraints->numberOfOtherConstraintResults; k++)
01134 {
01135 outStr << "<other";
01136 if (m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon > 0)
01137 {
01138 outStr << " numberOfCon=\"";
01139 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon;
01140 outStr << "\"";
01141 }
01142 else if(m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations > 0)
01143 {
01144 outStr << " numberOfEnumerations=\"";
01145 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations;
01146 outStr << "\"";
01147 }
01148 outStr << " name=";
01149 \
01150 outStr << writeStringData(m_OSResult->optimization->solution[i]->constraints->other[k]->name);
01151 if (m_OSResult->optimization->solution[i]->constraints->other[k]->value != "")
01152 {
01153 outStr << " value=\"";
01154 \
01155 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->value;
01156 outStr << "\"" ;
01157 };
01158 if (m_OSResult->optimization->solution[i]->constraints->other[k]->type != "")
01159 {
01160 outStr << " type=\"";
01161 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->type;
01162 outStr << "\"" ;
01163
01164 }
01165 if (m_OSResult->optimization->solution[i]->constraints->other[k]->description != "")
01166 {
01167 outStr << " description=";
01168 outStr << writeStringData(m_OSResult->optimization->solution[i]->constraints->other[k]->description);
01169 };
01170 if (m_OSResult->optimization->solution[i]->constraints->other[k]->conType != "")
01171 {
01172 outStr << " conType=\"";
01173 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->conType;
01174 outStr << "\"" ;
01175 }
01176 if (m_OSResult->optimization->solution[i]->constraints->other[k]->enumType != "")
01177 {
01178 outStr << " enumType=\"";
01179 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->enumType;
01180 outStr << "\"" ;
01181 }
01182 outStr << ">" << endl;
01183 if(m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon > 0)
01184 {
01185 for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfCon; j++)
01186 {
01187 outStr << "<con";
01188 outStr << " idx=\"";
01189 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->idx;
01190 outStr << "\"";
01191 if (m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->name != "")
01192 outStr << " name=" << writeStringData(m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->name);
01193 outStr << ">";
01194 outStr << m_OSResult->optimization->solution[i]->constraints->other[k]->con[j]->value;
01195 outStr << "</con>" << endl;
01196 }
01197 }
01198 else if (m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations > 0)
01199 {
01200 for(j = 0; j < m_OSResult->optimization->solution[i]->constraints->other[k]->numberOfEnumerations; j++)
01201 {
01202 outStr << writeOtherOptionOrResultEnumeration(m_OSResult->optimization->solution[i]->constraints->other[k]->enumeration[j],
01203 m_bWhiteSpace, m_bWriteBase64);
01204 }
01205 }
01206 outStr << "</other>" << endl;
01207 }
01208 }
01209 }
01210 outStr << "</constraints>" << endl;
01211 }
01212
01213 if(m_OSResult->optimization->solution[i]->matrixProgramming != NULL)
01214 {
01215 #ifndef NDEBUG
01216 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
01217 "output <matrixProgramming>");
01218 #endif
01219 outStr << "<matrixProgramming";
01220 if (m_OSResult->optimization->solution[i]->matrixProgramming
01221 ->numberOfOtherMatrixProgrammingResults > 0)
01222 outStr << " numberOfOtherMatrixProgrammingResults=\""
01223 << m_OSResult->optimization->solution[i]->matrixProgramming
01224 ->numberOfOtherMatrixProgrammingResults << "\"";
01225 outStr << ">" << endl;
01226
01227 if(m_OSResult->optimization->solution[i]->matrixProgramming->matrixVariables != NULL)
01228 {
01229 MatrixVariableSolution* tmpVar
01230 = m_OSResult->optimization->solution[i]->matrixProgramming->matrixVariables;
01231 #ifndef NDEBUG
01232 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace,
01233 "output <matrixVariables>");
01234 #endif
01235 outStr << "<matrixVariables";
01236 if (tmpVar->numberOfOtherMatrixVariableResults > 0)
01237 outStr << " numberOfOtherMatrixVariableResults=\""
01238 << tmpVar->numberOfOtherMatrixVariableResults << "\"";
01239 outStr << ">" << endl;
01240
01241 if (tmpVar->values != NULL)
01242 {
01243 outStr << "<values numberOfMatrixVar=\""
01244 << tmpVar->values->numberOfMatrixVar << "\">" << std::endl;
01245 for (int var=0; var < tmpVar->values->numberOfMatrixVar; var++)
01246 outStr << tmpVar->values->matrixVar[var]->getMatrixNodeInXML();
01247 }
01248 outStr << "</values>" << endl;
01249 if (tmpVar->numberOfOtherMatrixVariableResults > 0 &&
01250 tmpVar->other != NULL)
01251 {
01252 for (int j=0; j < tmpVar->numberOfOtherMatrixVariableResults; j++)
01253 {
01254 outStr << "<other name=\"" << tmpVar->other[j]->name << "\"";
01255 if (tmpVar->other[j]->description != "")
01256 outStr << " description=\"" << tmpVar->other[j]->description << "\"";
01257 if (tmpVar->other[j]->value != "")
01258 outStr << " value=\"" << tmpVar->other[j]->value << "\"";
01259 if (tmpVar->other[j]->type != "")
01260 outStr << " type=\"" << tmpVar->other[j]->type << "\"";
01261 if (tmpVar->other[j]->solver != "")
01262 outStr << " solver=\"" << tmpVar->other[j]->solver << "\"";
01263 if (tmpVar->other[j]->category != "")
01264 outStr << " category=\"" << tmpVar->other[j]->category << "\"";
01265 if (tmpVar->other[j]->numberOfMatrixVar != 0)
01266 outStr << " numberOfMatrixVar=\""
01267 << tmpVar->other[j]->numberOfMatrixVar << "\"";
01268 if (tmpVar->other[j]->matrixType != "")
01269 outStr << " matrixType=\"" << tmpVar->other[j]->matrixType << "\"";
01270 if (tmpVar->other[j]->numberOfEnumerations != 0)
01271 outStr << " numberOfEnumerations=\""
01272 << tmpVar->other[j]->numberOfEnumerations << "\"";
01273 if (tmpVar->other[j]->enumType != "")
01274 outStr << " enumType=\"" << tmpVar->other[j]->enumType << "\"";
01275
01276 if (tmpVar->other[j]->numberOfMatrixVar == 0 &&
01277 tmpVar->other[j]->numberOfEnumerations == 0)
01278 {
01279 outStr << "/>" << endl;
01280 }
01281 else
01282 {
01283 outStr << ">" << endl;
01284 if (tmpVar->other[j]->numberOfMatrixVar > 0)
01285 for (int var=0; var < tmpVar->other[j]->numberOfMatrixVar; var++)
01286 outStr << tmpVar->other[j]->matrixVar[var]->getMatrixNodeInXML();
01287
01288 if (tmpVar->other[j]->numberOfEnumerations > 0)
01289 for(int k = 0; k < tmpVar->other[j]->numberOfEnumerations; k++)
01290 {
01291 outStr << writeOtherOptionOrResultEnumeration(
01292 tmpVar->other[j]->enumeration[j],
01293 m_bWhiteSpace, m_bWriteBase64);
01294 }
01295
01296 outStr << "</other>" << endl;
01297 }
01298 }
01299 }
01300 outStr << "</matrixVariables>" << endl;
01301 }
01302 outStr << "</matrixProgramming>" << endl;
01303 }
01304
01305 #ifndef NDEBUG
01306 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <otherSolutionResults>");
01307 #endif
01308 if (m_OSResult->optimization->solution[i]->otherSolutionResults != NULL)
01309 {
01310 outStr << "<otherSolutionResults numberOfOtherSolutionResults=\"";
01311 outStr << m_OSResult->optimization->solution[i]->otherSolutionResults->numberOfOtherSolutionResults;
01312 outStr << "\">" << std::endl;
01313 for(int k = 0; k < m_OSResult->optimization->solution[i]->otherSolutionResults->numberOfOtherSolutionResults; k++)
01314 {
01315 outStr << "<otherSolutionResult";
01316 outStr << " name=";
01317 outStr << writeStringData(m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->name);
01318 outStr << " value=";
01319 outStr << writeStringData(m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->value);
01320 outStr << " numberOfItems=\"";
01321 outStr << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->numberOfItems;
01322 outStr << "\"";
01323 if (m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->category != "")
01324 outStr << " category=\"" << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->category << "\"";
01325 if (m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->description != "")
01326 outStr << " description=" << writeStringData(m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->description);
01327 outStr << ">" << std::endl;
01328 for(int j = 0; j < m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->numberOfItems; j++)
01329 outStr << "<item>" << m_OSResult->optimization->solution[i]->otherSolutionResults->otherSolutionResult[k]->item[j] << "</item>" << std::endl;
01330 outStr << "</otherSolutionResult>" << std::endl;
01331 }
01332 outStr << "</otherSolutionResults>" << std::endl;
01333 }
01334 outStr << "</solution>" << endl;
01335 }
01336 }
01337
01338
01339 #ifndef NDEBUG
01340 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "output <otherSolverOutput>");
01341 #endif
01342 if (m_OSResult->optimization->otherSolverOutput != NULL)
01343
01344 {
01345 outStr << "<otherSolverOutput numberOfSolverOutputs=\"";
01346 outStr << m_OSResult->optimization->otherSolverOutput->numberOfSolverOutputs;
01347 outStr << "\">" << std::endl;
01348 for(int k = 0; k < m_OSResult->optimization->otherSolverOutput->numberOfSolverOutputs; k++)
01349 {
01350 outStr << "<solverOutput";
01351 outStr << " name=\"";
01352 outStr << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->name;
01353 outStr << "\"";
01354 outStr << " numberOfItems=\"";
01355 outStr << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->numberOfItems;
01356 outStr << "\"";
01357 if (m_OSResult->optimization->otherSolverOutput->solverOutput[k]->category != "")
01358 outStr << " category=\"" << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->category << "\"";
01359 if (m_OSResult->optimization->otherSolverOutput->solverOutput[k]->description != "")
01360 outStr << " description=" << writeStringData(m_OSResult->optimization->otherSolverOutput->solverOutput[k]->description);
01361 outStr << ">" << std::endl;
01362 for(int j = 0; j < m_OSResult->optimization->otherSolverOutput->solverOutput[k]->numberOfItems; j++)
01363 {
01364 outStr << "<item>" << m_OSResult->optimization->otherSolverOutput->solverOutput[k]->item[j] << "</item>" << std::endl;
01365 }
01366 outStr << "</solverOutput>" << std::endl;
01367 }
01368 outStr << "</otherSolverOutput>" << std::endl;
01369 }
01370
01371 outStr << "</optimization>" << endl;
01372 }
01373 outStr << "</osrl>" << endl ;
01374 #ifndef NDEBUG
01375 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSrLwriter, ENUM_OUTPUT_LEVEL_trace, "done");
01376 #endif
01377 return outStr.str();
01378 }
01379
01380