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