OSResult.cpp
Go to the documentation of this file.
1 
17 #include "OSResult.h"
18 #include "OSParameters.h"
19 #include "OSErrorClass.h"
20 
21 
22 #include "OSDataStructures.h"
23 #include "OSParameters.h"
24 #include "OSCommonUtil.h"
25 #include "OSMathUtil.h"
26 
27 #include<iostream>
28 #include<sstream>
29 #define DEBUG
30 
31 using namespace std;
32 
34  type( ""),
35  description( "")
36 {
37  #ifdef DEBUG
38  cout << "Inside GeneralStatus Constructor" << endl;
39  #endif
40 }// end GeneralStatus constructor
41 
43  #ifdef DEBUG
44  cout << "GeneralStatus Destructor Called" << endl;
45  #endif
46 }//end GeneralStatus destructor
47 
49  m_iVariableNumber( -1),
50  m_iObjectiveNumber( -1),
51  m_iConstraintNumber( -1),
52  m_iNumberOfOtherVariableResults( -1),
53  m_mdPrimalValues( NULL),
54  m_mdDualValues( NULL)
55 
56 {
57  #ifdef DEBUG
58  cout << "Inside OSResult Constructor" << endl;
59  #endif
60  this->general = new GeneralResult();
61  this->system = new SystemResult();
62  this->service = new ServiceResult();
63  this->job = new JobResult();
64  this->optimization = new OptimizationResult();
65 }// end OSResult constructor
66 
68  #ifdef DEBUG
69  cout << "OSResult Destructor Called" << endl;
70  #endif
71  // delete the children of OSResult
72  // delete general object
73  if(general != NULL) delete general;
74  general = NULL;
75  //delete system object
76  if(system != NULL) delete system;
77  system = NULL;
78  //delete service object
79  if(service != NULL) delete service;
80  service = NULL;
81  //delete job object
82  if(job != NULL) delete job;
83  job = NULL;
84  //delete optimization object
85  if(optimization != NULL) delete optimization;
86  optimization = NULL;
87 
88  if(m_mdPrimalValues != NULL) delete[] m_mdPrimalValues;
89  m_mdPrimalValues = 0;
90  if(m_mdDualValues != NULL) delete[] m_mdDualValues;
91  m_mdDualValues = 0;
92 }//end OSResult destructor
93 
94 
96  serviceURI(""),
97  serviceName(""),
98  instanceName(""),
99  jobID(""),
100  time("0.0"),
101  message("")
102 {
103  #ifdef DEBUG
104  cout << "Inside the GeneralResult Constructor" << endl;
105  #endif
106  generalStatus = new GeneralStatus();
107 }//end GeneralResult constructor
108 
109 
111  #ifdef DEBUG
112  cout << "Inside the GeneralResult Destructor" << endl;
113  #endif
114  delete generalStatus;
115  generalStatus = NULL;
116 }// end GeneralResult destructor
117 
118 
120 {
121  #ifdef DEBUG
122  cout << "Inside the SystemResult Constructor" << endl;
123  #endif
124 }//end SystemResult constructor
125 
126 
128  #ifdef DEBUG
129  cout << "Inside the SystemResult Destructor" << endl;
130  #endif
131 }// end SystemResult destructor
132 
133 
134 
136 {
137  #ifdef DEBUG
138  cout << "Inside the ServiceResult Constructor" << endl;
139  #endif
140 }//end ServiceResult constructor
141 
142 
144  #ifdef DEBUG
145  cout << "Inside the ServiceResult Destructor" << endl;
146  #endif
147 }// end ServiceResult destructor
148 
149 
151  type("elapsedTime"),
152  category("total"),
153  unit("second"),
154  description(""),
155  value(0.0)
156 {
157  #ifdef DEBUG
158  cout << "Inside the Time Constructor" << endl;
159  #endif
160 }//end Time constructor
161 
162 
164  #ifdef DEBUG
165  cout << "Inside the Time Destructor" << endl;
166  #endif
167 
168 }// end TimingInformation destructor
169 
171  numberOfTimes(0)
172 {
173  #ifdef DEBUG
174  cout << "Inside the TimingInformation Constructor" << endl;
175  #endif
176  time = NULL;
177 }//end TimingInformation constructor
178 
179 
181  #ifdef DEBUG
182  cout << "Inside the TimingInformation Destructor" << endl;
183  #endif
184  if (time != NULL)
185  {
186  for (int i = 0; i < numberOfTimes; i++)
187  { delete time[i];
188  time[i] = NULL;
189  }
190  delete [] time;
191  time = NULL;
192  }
193 }// end TimingInformation destructor
194 
195 
197 {
198  #ifdef DEBUG
199  cout << "Inside the JobResult Constructor" << endl;
200  #endif
201  timingInformation = NULL;
202 }//end JobResult constructor
203 
204 
206  #ifdef DEBUG
207  cout << "Inside the JobResult Destructor" << endl;
208  #endif
209  if (timingInformation != NULL) delete timingInformation;
210  timingInformation = NULL;
211 }// end JobResult destructor
212 
214  idx( -1),
215  value( 0)
216 {
217  #ifdef DEBUG
218  cout << "Inside the VarValue Constructor" << endl;
219  #endif
220 }//end VarValue constructor
221 
222 
224  #ifdef DEBUG
225  cout << "Inside the VarValue Destructor" << endl;
226  #endif
227 }// end VarValue destructor
228 
229 
231  idx( -1),
232  value( "")
233 {
234  #ifdef DEBUG
235  cout << "Inside the OtherVarResult Constructor" << endl;
236  #endif
237 }//end OtherVarResult constructor
238 
239 
241  #ifdef DEBUG
242  cout << "Inside the OtherVarResult Destructor" << endl;
243  #endif
244 }// end OtherVarResult destructor
245 
246 
248  idx( -1),
249  value( "")
250 {
251  #ifdef DEBUG
252  cout << "Inside the OtherObjResult Constructor" << endl;
253  #endif
254 }//end OtherObjResult constructor
255 
256 
258  #ifdef DEBUG
259  cout << "Inside the OtherObjResult Destructor" << endl;
260  #endif
261 }//end OtherObjResult destructor
262 
263 
265  idx( -1),
266  value( "")
267 {
268  #ifdef DEBUG
269  cout << "Inside the OtherConResult Constructor" << endl;
270  #endif
271 }//end OtherConResult constructor
272 
273 
275  #ifdef DEBUG
276  cout << "Inside the OtherConResult Destructor" << endl;
277  #endif
278 }//end OtherConResult destructor
279 
280 
282  idx( -1),
283  value( OSNAN)
284 {
285  #ifdef DEBUG
286  cout << "Inside the ObjValue Constructor" << endl;
287  #endif
288 }//end ObjValue constructor
289 
291  #ifdef DEBUG
292  cout << "Inside the ObjValue Destructor" << endl;
293  #endif
294 }// end ObjValue destructor
295 
297  idx( -1),
298  lbValue( 0),
299  ubValue( 0),
300  value( 0)
301 {
302  #ifdef DEBUG
303  cout << "Inside the DualVarValue Constructor" << endl;
304  #endif
305 }//end DualVarValue constructor
306 
307 
309  #ifdef DEBUG
310  cout << "Inside the DualVarValue Destructor" << endl;
311  #endif
312 }// end DualVarValue destructor
313 
314 
315 
317  #ifdef DEBUG
318  cout << "Inside the VariableValues Constructor" << endl;
319  #endif
320 
321 }//end VariableValues constructor
322 
323 
325  #ifdef DEBUG
326  cout << "Inside the VariableValues Destructor" << endl;
327  #endif
328  int n = var.size();
329  if(n > 0 ){
330  for(int i = 0; i < n; i++){
331  delete var[i];
332  var[i] = NULL;
333  }
334  }
335  var.clear();
336 
337 }// end VariableValues destructor
338 
339 
341  numberOfVar(-1),
342  value(""),
343  name(""),
344  description("")
345 {
346  #ifdef DEBUG
347  cout << "Inside the OtherVariableResult Constructor" << endl;
348  #endif
349 
350 }//end OtherVariableResult constructor
351 
352 
354  #ifdef DEBUG
355  cout << "Inside the OtherVariableResult Destructor" << endl;
356  #endif
357  int n = var.size();
358  if (n > 0) {
359  for(int i = 0; i < n; i++){
360  delete var[i];
361  var[i] = NULL;
362  }
363  }
364  var.clear();
365  #ifdef DEBUG
366  cout << "Inside the OtherVariableResult Destructor - Done" << endl;
367  #endif
368 }// end OtherVariableResult destructor
369 
370 
372  name(""),
373  description("")
374 {
375  #ifdef DEBUG
376  cout << "Inside the OtherObjectiveResult Constructor" << endl;
377  #endif
378 }//end OtherObjectiveResult constructor
379 
380 
382  #ifdef DEBUG
383  cout << "Inside the OtherObjectiveResult Destructor" << endl;
384  #endif
385  int n = obj.size();
386  if(n > 0) {
387  for(int i = 0; i < n; i++){
388  delete obj[i];
389  obj[i] = NULL;
390  }
391  }
392  obj.clear();
393 }// end OtherObjectiveResult destructor
394 
395 
397  name(""),
398  description("")
399 {
400  #ifdef DEBUG
401  cout << "Inside the OtherConstraintResult Constructor" << endl;
402  #endif
403 }//end OtherConstraintResult constructor
404 
405 
407  #ifdef DEBUG
408  cout << "Inside the OtherConstraintResult Destructor" << endl;
409  #endif
410  int n = con.size();
411  if(n > 0){
412  for(int i = 0; i < n; i++){
413  delete con[i];
414  con[i] = NULL;
415  }
416  }
417  con.clear();
418 }// end OtherObjectiveResult destructor
419 
420 
422  #ifdef DEBUG
423  cout << "Inside the ObjectiveValues Constructor" << endl;
424  #endif
425 
426 }//end ObjectiveValues constructor
427 
428 
430  #ifdef DEBUG
431  cout << "Inside the ObjectiveValues Destructor" << endl;
432  #endif
433  int n = obj.size();
434  if(n > 0 ){
435  for(int i = 0; i < n; i++){
436  delete obj[i];
437  obj[i] = NULL;
438  }
439  }
440  obj.clear();
441 
442 }// end ObjectiveValues destructor
443 
444 
445 
447  #ifdef DEBUG
448  cout << "Inside the DualVariableValues Constructor" << endl;
449  #endif
450 
451 }//end DualVariableValues constructor
452 
453 
455  #ifdef DEBUG
456  cout << "Inside the DualVariableValues Destructor" << endl;
457  #endif
458  int n = con.size();
459  if(n > 0){
460  for(int i = 0; i < n; i++){
461  delete con[i];
462  con[i] = NULL;
463  }
464  }
465  con.clear();
466 }// end DualVariableValues destructor
467 
468 
469 
471  numberOfOtherVariableResults( 0),
472  values( NULL),
473  other( NULL)
474 
475 {
476  #ifdef DEBUG
477  cout << "Inside the VariableSolution Constructor" << endl;
478  #endif
479 }//end VariableSolution constructor
480 
481 
483  #ifdef DEBUG
484  cout << "Inside the VariableSolution Destructor" << endl;
485  #endif
486  delete values;
487  values = NULL;
488  if(numberOfOtherVariableResults > 0 && other != NULL){
489  for(int i = 0; i < numberOfOtherVariableResults; i++){
490  delete other[i];
491  other[i] = NULL;
492  }
493  }
494  delete[] other;
495  other = NULL;
496 }// end VariableSolution destructor
497 
499  numberOfOtherObjectiveResults( 0),
500  values( NULL),
501  other( NULL)
502 
503 {
504  #ifdef DEBUG
505  cout << "Inside the ObjectiveSolution Constructor" << endl;
506  #endif
507 }//end ObjectiveSolution constructor
508 
509 
511  #ifdef DEBUG
512  cout << "Inside the ObjectieSolution Destructor" << endl;
513  #endif
514  delete values;
515  values = NULL;
516  if(numberOfOtherObjectiveResults > 0 && other != NULL){
517  for(int i = 0; i < numberOfOtherObjectiveResults; i++){
518  delete other[i];
519  other[i] = NULL;
520  }
521  }
522  delete[] other;
523  other = NULL;
524 }// end ObjectiveSolution destructor
525 
526 
527 
529  numberOfOtherConstraintResults( 0),
530  dualValues( NULL),
531  other( NULL)
532 {
533  #ifdef DEBUG
534  cout << "Inside the ConstraintSolution Constructor" << endl;
535  #endif
536 }//end ConstraintSolution constructor
537 
538 
540  #ifdef DEBUG
541  cout << "Inside the ConstraintSolution Destructor" << endl;
542  #endif
543  delete dualValues;
544  dualValues = NULL;
545  if(numberOfOtherConstraintResults > 0 && other != NULL){
546  for(int i = 0; i < numberOfOtherConstraintResults; i++){
547  delete other[i];
548  other[i] = NULL;
549  }
550  }
551  delete[] other;
552  other = NULL;
553 }// end ConstraintSolution destructor
554 
555 
556 
558  type(""),
559  description("")
560  //substatus( NULL),
561 {
562  #ifdef DEBUG
563  cout << "Inside the OptimizationSolutionStatus Constructor" << endl;
564  #endif
565 }//end OptimizationSolutionStatus constructor
566 
567 
569  #ifdef DEBUG
570  cout << "Inside the OptimzationSolutionStatus Destructor" << endl;
571  #endif
572 }// end OptimizationSolutionStatus destructor
573 
574 
576  targetObjectiveIdx( -1),
577  message( ""),
578  variables( NULL),
579  objectives( NULL),
580  constraints( NULL)
581  //other(NULL)
582 {
583  #ifdef DEBUG
584  cout << "Inside the OptimizationSolution Constructor" << endl;
585  #endif
586  status = new OptimizationSolutionStatus();
587 }//end OptimizationSolution constructor
588 
589 
591  #ifdef DEBUG
592  cout << "Inside the OptimzationSolution Destructor" << endl;
593  #endif
594  if(variables != NULL){
595  delete variables;
596  variables = NULL;
597  }
598  if(constraints != NULL) {
599  delete constraints;
600  constraints = NULL;
601  }
602  if(objectives != NULL){
603  delete objectives;
604  objectives = NULL;
605  }
606  if(status != NULL){
607  delete status;
608  status = NULL;
609  }
610 }// end OptimizationSolution destructor
611 
612 
614  numberOfVariables( -1),
615  numberOfObjectives( -1),
616  numberOfConstraints(-1),
617  numberOfSolutions( -1),
618  solution(NULL)
619 {
620  #ifdef DEBUG
621  cout << "Inside the OptimizationResult Constructor" << endl;
622  #endif
623 }//end OptimizationResult constructor
624 
625 
627  #ifdef DEBUG
628  cout << "Inside the OptimzationResult Destructor" << endl;
629  cout << "Number of solutions = " << this->numberOfSolutions << endl;
630  #endif
631  if( solution != NULL){
632  for(int i = 0; i < this->numberOfSolutions; i++){
633  delete solution[i];
634  solution[i] = NULL;
635  #ifdef DEBUG
636  cout << "Delelting Solution: " << i << endl;
637  #endif
638  i++;
639  }
640  }
641  delete[] solution;
642  solution = NULL;
643 }// end OptimizationResult destructor
644 
645 
646 
647 //
648 // get methods
649 
651  return general->generalStatus;
652 }//getGeneralStatus
653 
654 
656  if(general->generalStatus == NULL) return "";
657  return general->generalStatus->type;
658 }//getGeneralStatusType
659 
661  if(general->generalStatus == NULL) return NULL;
663 }//getGeneralStatusDescription
664 
665 string OSResult::getServiceName(){
666  return general->serviceName;
667 }//getServiceName
668 
669 string OSResult::getServiceURI(){
670  return general->serviceURI;
671 }//getServiceURI
672 
674  return general->instanceName;
675 }//getInstanceName
676 
677 string OSResult::getJobID(){
678  return general->jobID;
679 }//getJobID
680 
681 
683  return general->message;
684 }//getGeneralMessage
685 
686 
687 double OSResult::getTimeValue()
688 { if (job == NULL) return 0.0;
689  if (job->timingInformation == NULL) return 0.0;
690  if (job->timingInformation->numberOfTimes <= 0) return 0.0;
691  return job->timingInformation->time[0]->value;
692 }//getTime
693 
694 
696 { if (job == NULL) return -1;
697  if (job->timingInformation == NULL) return -1;
699 }//getTime
700 
701 
703  if(m_iVariableNumber == -1){
704  if(optimization == NULL) return -1;
706  }
707  return m_iVariableNumber;
708 }//getVariableNumber
709 
710 
711 
713  if(m_iObjectiveNumber == -1){
714  if(optimization == NULL) return -1;
716  }
717  return m_iObjectiveNumber;
718 }//getObjectiveNumber
719 
720 
722  if(m_iConstraintNumber == -1){
723  if(optimization == NULL) return -1;
725  }
726  return m_iConstraintNumber;
727 }//getConstraintNumber
728 
730  if(optimization == NULL) return 0;
731  if(optimization->solution == NULL) return 0;
733 }//getSolutionNumber
734 
735 
738  if(optimization->solution[solIdx]->variables->other == NULL) return -1;
740  }
742 }//getNumberOfOtherVariableResults
743 
744 
746  if(optimization == NULL || optimization->solution == NULL) return NULL;
747  if( optimization->numberOfSolutions <= 0 ||
748  solIdx < 0 || solIdx >= optimization->numberOfSolutions) return NULL;
749  if(optimization->solution[solIdx] == NULL) return NULL;
750  return optimization->solution[solIdx]->status;
751 }//getSolutionStatus
752 
753 string OSResult::getSolutionStatusType(int solIdx){
754  if(optimization == NULL || optimization->solution == NULL) return NULL;
755  if( optimization->numberOfSolutions <= 0 ||
756  solIdx < 0 || solIdx >= optimization->numberOfSolutions) return NULL;
757  if(optimization->solution[solIdx] == NULL) return NULL;
758  if(optimization->solution[solIdx]->status == NULL) return NULL;
759  return optimization->solution[solIdx]->status->type;
760 }//getSolutionStatusType
761 
762 string OSResult::getSolutionStatusDescription(int solIdx){
763  if(optimization == NULL || optimization->solution == NULL) return NULL;
764  if( optimization->numberOfSolutions <= 0 ||
765  solIdx < 0 || solIdx >= optimization->numberOfSolutions) return NULL;
766  if(optimization->solution[solIdx] == NULL) return NULL;
767  if(optimization->solution[solIdx]->status == NULL) return NULL;
768  return optimization->solution[solIdx]->status->description;
769 }//getSolutionStatusDescription
770 
771 string OSResult::getSolutionMessage(int solIdx){
772  if(optimization == NULL) return "there is no solution";
773  if(optimization->solution == NULL ||
774  solIdx < 0 || solIdx >= optimization->numberOfSolutions) return "there is no solution";
775  if(optimization->solution[solIdx] == NULL) return "there is no solution";
776  return optimization->solution[solIdx]->message;
777 }//getSolutionMessage
778 
779 double* OSResult::getOptimalPrimalVariableValues(int objIdx){
780  if(optimization == NULL || optimization->solution == NULL) return NULL;
781  int iNumberOfVariables = this->getVariableNumber();
782  if(iNumberOfVariables <= 0) return NULL;
783  int iSolutions = this->getSolutionNumber();
784  for(int i = 0; i < iSolutions; i++){
785  if(optimization->solution[i] == NULL) continue;
786  if(optimization->solution[i]->targetObjectiveIdx != objIdx) continue;
787  if(optimization->solution[i]->variables == NULL) continue;
788  if(optimization->solution[i]->variables->values == NULL) continue;
789  if((optimization->solution[i]->status->type.find("ptimal") != string::npos && m_mdPrimalValues == NULL) ||
790  optimization->solution[i]->status->type.compare("globallyOptimal") == 0){
791  m_mdPrimalValues = new double[iNumberOfVariables];
792  for(int j = 0; j < iNumberOfVariables; j++){
793  m_mdPrimalValues[ j] = optimization->solution[i]->variables->values->var[j]->value;
794  }
795  }
796  if(optimization->solution[i]->status->type.compare("globallyOptimal") == 0){
797  return m_mdPrimalValues;
798  }
799  }
800  return m_mdPrimalValues;
801 }//getOptimalPrimalVariableValues
802 
803 
804 double* OSResult::getOptimalDualVariableValues(int objIdx){
805  if(optimization == NULL || optimization->solution == NULL) return NULL;
806  int iNumberOfConstraints = this->getConstraintNumber();
807  if(iNumberOfConstraints <= 0) return NULL;
808  int iSolutions = this->getSolutionNumber();
809  for(int i = 0; i < iSolutions; i++){
810  if(optimization->solution[i] == NULL) continue;
811  if(optimization->solution[i]->targetObjectiveIdx != objIdx) continue;
812  if(optimization->solution[i]->constraints == NULL) continue;
813  if(optimization->solution[i]->constraints->dualValues == NULL) continue;
814  if((optimization->solution[i]->status->type.find("ptimal") != string::npos && m_mdDualValues == NULL) ||
815  optimization->solution[i]->status->type.compare("globallyOptimal") == 0){
816  m_mdDualValues = new double[iNumberOfConstraints];
817  for(int j = 0; j < iNumberOfConstraints; j++){
818  m_mdDualValues[ j] = optimization->solution[i]->constraints->dualValues->con[j]->value;
819  }
820  }
821  if(optimization->solution[i]->status->type.compare("globallyOptimal")){
822  return m_mdDualValues;
823  }
824  }
825  return m_mdDualValues;
826 }//getOptimalDualVariableValues
827 
828 // set methods
829 
831  general->generalStatus = status;
832  return true;
833 }//setGeneralStatus
834 
835 bool OSResult::setGeneralStatusType(string type){
837  general->generalStatus->type = type;
838  return true;
839 }//setGeneralStatusType
840 
841 bool OSResult::addTimingInformation(std::string type, std::string category,
842  std::string unit, std::string description, double value)
843 { int nt; int i;
844  cout << "add timing information: " << endl;
845  cout << "type " << type << endl;
846  cout << "category " << category << endl;
847  cout << "unit " << unit << endl;
848  cout << "description " << description << endl;
849  cout << "value " << value << endl;
850  if (job == NULL) job = new JobResult();
852 
854  cout << "allocate new pointers" << endl;
855  Time** temp = new Time*[nt+1]; //Allocate the new pointers
856  cout << " copy pointers --- " << nt << endl;
857  for (i = 0; i < nt; i++)
858  temp[i] = job->timingInformation->time[i]; //copy the pointers
859 
860  cout << "delete old pointers" << endl;
861  delete[] job->timingInformation->time; //delete old pointers
862 
863 // add in the new element
864  cout << "add new element" << endl;
865  temp[ nt] = new Time();
866 
867  temp[ nt]->type = type;
868  temp[ nt]->category = category;
869  temp[ nt]->unit = unit;
870  temp[ nt]->description = description;
871  temp[ nt]->value = value;
872 
873  cout << "hook new pointers into OSResult" << endl;
874  job->timingInformation->time = temp; //hook the new pointers into the data structure
876 
877  cout << "done" << endl;
878  return true;
879 }//addTimingInformation
880 
881 
882 bool OSResult::setGeneralStatusDescription(string description){
884  general->generalStatus->description = description;
885  return true;
886 }//setGeneralStatusDescription
887 
888 
889 
890 bool OSResult::setServiceName(string serviceName){
891  general->serviceName = serviceName;
892  return true;
893 }//setServiceName
894 
895 bool OSResult::setServiceURI(string serviceURI){
896  general->serviceURI = serviceURI;
897  return true;
898 }//setServiceURI
899 
900 bool OSResult::setInstanceName(string instanceName){
901  general->instanceName = instanceName;
902  return true;
903 }//setInstanceName
904 
905 bool OSResult::setJobID(string jobID){
906  general->jobID = jobID;
907  return true;
908 }//setJobID
909 
910 bool OSResult::setTime(double time){
911 // general->time = os_dtoa_format( time);
912  return addTimingInformation("elapsedTime", "total", "second", "", time);
913 }//setTime
914 
915 bool OSResult::setTimeNumber(int timeNumber)
916 { if (job == NULL) job = new JobResult();
918  if (timeNumber <= 0) return false;
919  job->timingInformation->numberOfTimes = timeNumber;
920  return true;
921 }//setTimeNumber
922 
923 bool OSResult::setGeneralMessage(string message){
924  general->message = message;
925  return true;
926 }//setGeneralMessage
927 
928 bool OSResult::setVariableNumber(int variableNumber){
929  if(variableNumber <= 0){
930  return false;
931  }
932  if(optimization == NULL) optimization = new OptimizationResult();
933  optimization->numberOfVariables = variableNumber;
934  return true;
935 }//setVariableNumber
936 
937 bool OSResult::setObjectiveNumber(int objectiveNumber){
938  if(objectiveNumber < 0){
939  return false;
940  }
941  if(optimization == NULL) optimization = new OptimizationResult();
942  optimization->numberOfObjectives = objectiveNumber;
943  return true;
944 }//setObjectiveNumber
945 
946 bool OSResult::setConstraintNumber(int constraintNumber){
947  if(constraintNumber < 0){
948  return false;
949  }
950  if(optimization == NULL) optimization = new OptimizationResult();
951  optimization->numberOfConstraints = constraintNumber;
952  return true;
953 }//setConstraintNumber
954 
955 bool OSResult::setSolutionNumber(int number){
956  //if(getVariableNumber() <= 0) return false;
957  //if(getObjectiveNumber() < 0) return false;
958  //if(getConstraintNumber() < 0) return false;
959  if(number < 0) return false;
960  if(number == 0) return true;
961  if(optimization == NULL) optimization = new OptimizationResult();
964  for(int i = 0; i < number; i++){
965  std::cout << "CREATING A NEW OPTIMIZATION SOLUTION" << std::endl;
967  std::cout << "DONE CREATING A NEW OPTIMIZATION SOLUTION" << std::endl;
968  }
969  return true;
970 }//setSolutionNumber
971 
972 bool OSResult::setSolutionStatus(int solIdx, string type, string description){
973  int nSols = this->getSolutionNumber();
974  if(optimization == NULL) return false;
975  if(nSols <= 0) return false;
976  if(optimization->solution == NULL ||
977  solIdx < 0 || solIdx >= nSols) return false;
978  if(optimization->solution[solIdx] == NULL){
979  optimization->solution[solIdx] = new OptimizationSolution();
980  }
981  if(optimization->solution[solIdx]->status == NULL){
983  }
984  // Kipp later when we finalize on type come back and require that the type be correct
985  optimization->solution[solIdx]->status->type = type;
986  optimization->solution[solIdx]->status->description = description;
987  return true;
988 }//setSolutionStatus
989 
990 bool OSResult::setSolutionObjectiveIndex(int solIdx, int objectiveIdx){
991  int nSols = this->getSolutionNumber();
992  if(optimization == NULL) return false;
993  if(nSols <= 0) return false;
994  if(optimization == NULL) return false;
995  if(optimization->solution == NULL ||
996  solIdx < 0 || solIdx >= nSols) return false;
997  if(optimization->solution[solIdx] == NULL){
998  optimization->solution[solIdx] = new OptimizationSolution();
999  }
1000  if(objectiveIdx >= 0) return false;
1001  optimization->solution[solIdx]->targetObjectiveIdx = objectiveIdx;
1002  return true;
1003 }//setSolutionObjectiveIndex
1004 
1005 bool OSResult::setNumberOfPrimalVariableValues(int solIdx, int numberOfVar){
1006  int nSols = this->getSolutionNumber();
1007  int nVar = this->getVariableNumber();
1008  if (numberOfVar <= 0 || numberOfVar > nVar) return false;
1009  if(optimization == NULL) return false;
1010  if(nSols <= 0) return false;
1011  if(optimization->solution == NULL ||
1012  solIdx < 0 || solIdx >= nSols) return false;
1013  if(optimization->solution[solIdx] == NULL){
1014  optimization->solution[solIdx] = new OptimizationSolution();
1015  }
1016  if(optimization->solution[solIdx]->variables == NULL){
1017  optimization->solution[solIdx]->variables = new VariableSolution();
1018  }
1019  if(optimization->solution[solIdx]->variables->values == NULL){
1021  }
1022  optimization->solution[solIdx]->variables->values->numberOfVar = numberOfVar;
1023 // optimization->solution[solIdx]->variables->values->var = new VarValue*[numberOfVar];
1024 
1025  return true;
1026 }//setNumberOfPrimalVariableValues
1027 
1028 bool OSResult::setPrimalVariableValues(int solIdx, double *x, int numberOfVar){
1029  int nSols = this->getSolutionNumber();
1030  if(optimization == NULL) return false;
1031  if(nSols <= 0) return false;
1032  if(optimization->solution == NULL ||
1033  solIdx < 0 || solIdx >= nSols) return false;
1034  if(optimization->solution[solIdx] == NULL){
1035  optimization->solution[solIdx] = new OptimizationSolution();
1036  }
1037  if(optimization->solution[solIdx]->variables == NULL){
1038  optimization->solution[solIdx]->variables = new VariableSolution();
1039  }
1040  if(optimization->solution[solIdx]->variables->values == NULL){
1042  }
1043  optimization->solution[solIdx]->variables->values->numberOfVar = numberOfVar;
1044  if(x == NULL){
1045  //optimization->solution[solIdx]->variables->values->var = NULL;
1046  return true;
1047  }
1048  for(int i = 0; i < numberOfVar; i++){
1049  optimization->solution[solIdx]->variables->values->var.push_back(new VarValue());
1050  optimization->solution[solIdx]->variables->values->var[i]->idx = i;
1051  optimization->solution[solIdx]->variables->values->var[i]->value = x[i];
1052  }
1053  return true;
1054 }//setPrimalVariableValues
1055 
1056 bool OSResult::setNumberOfOtherVariableResults(int solIdx, int numberOfOtherVariableResults){
1057  int iNumberOfVariables = this->getVariableNumber();
1058  if(iNumberOfVariables <= 0) return false;
1059  int nSols = this->getSolutionNumber();
1060  if(nSols <= 0) return false;
1061  if(optimization == NULL) return false;
1062  if(optimization->solution == NULL ||
1063  solIdx < 0 || solIdx >= nSols) return false;
1064  if(optimization->solution[solIdx] == NULL){
1065  optimization->solution[solIdx] = new OptimizationSolution();
1066  }
1067  if(optimization->solution[solIdx]->variables == NULL){
1068  optimization->solution[solIdx]->variables = new VariableSolution();
1069  }
1070  optimization->solution[solIdx]->variables->numberOfOtherVariableResults = numberOfOtherVariableResults;
1071  optimization->solution[solIdx]->variables->other = new OtherVariableResult*[ numberOfOtherVariableResults];
1072  for(int i = 0; i < numberOfOtherVariableResults; i++){
1073  optimization->solution[solIdx]->variables->other[ i] = new OtherVariableResult();
1074  }
1075  return true;
1076 }//setNumberOfOtherVariableResults
1077 
1078 
1079 
1080 bool OSResult::setAnOtherVariableResult(int solIdx, int otherIdx, string name, string description, int *indexes, string *s, int numberOfVar){
1081  int iNumberOfVariables = numberOfVar;
1082  if(iNumberOfVariables <= 0) return false;
1083  int nSols = this->getSolutionNumber();
1084  if(optimization == NULL) return false;
1085  if(nSols <= 0) return false;
1086  if(optimization == NULL) return false;
1087  if(optimization->solution == NULL ||
1088  solIdx < 0 || solIdx >= nSols) return false;
1089  if(optimization->solution[solIdx] == NULL) return false;
1090  if(optimization->solution[solIdx]->variables == NULL)return false;
1091  if(optimization->solution[solIdx]->variables->other == NULL) return false;
1092  if(optimization->solution[solIdx]->variables->other[ otherIdx] == NULL) return false;
1093  optimization->solution[solIdx]->variables->other[ otherIdx]->name = name;
1094  optimization->solution[solIdx]->variables->other[ otherIdx]->description = description;
1095  optimization->solution[solIdx]->variables->other[ otherIdx]->numberOfVar = numberOfVar;
1096  for(int i = 0; i < iNumberOfVariables; i++){
1097  optimization->solution[solIdx]->variables->other[ otherIdx]->var.push_back(new OtherVarResult());
1098  optimization->solution[solIdx]->variables->other[ otherIdx]->var[i]->idx = indexes[ i];
1099  optimization->solution[solIdx]->variables->other[ otherIdx]->var[i]->value = s[i];
1100  ;
1101  }
1102  return true;
1103 }//setAnOtherVariableResult
1104 
1105 bool OSResult::setNumberOfObjectiveValues(int solIdx, int numberOfObj){
1106  int nSols = this->getSolutionNumber();
1107  int nObj = this->getObjectiveNumber();
1108  if (numberOfObj <= 0 || numberOfObj > nObj) return false;
1109  if(optimization == NULL) return false;
1110  if(nSols <= 0) return false;
1111  if(optimization->solution == NULL ||
1112  solIdx < 0 || solIdx >= nSols) return false;
1113  if(optimization->solution[solIdx] == NULL){
1114  optimization->solution[solIdx] = new OptimizationSolution();
1115  }
1116  if(optimization->solution[solIdx]->objectives == NULL){
1118  }
1119  if(optimization->solution[solIdx]->objectives->values == NULL){
1121  }
1122  optimization->solution[solIdx]->objectives->values->numberOfObj = numberOfObj;
1123 // optimization->solution[solIdx]->objectives->values->obj = new ObjValue*[numberOfObj];
1124 
1125  return true;
1126 }//setNumberOfObjectiveValues
1127 
1128 
1129 
1130 bool OSResult::setObjectiveValues(int solIdx, double *objectiveValues, int numberOfObj){
1131  int iNumberOfObjectives = numberOfObj;
1132  if(iNumberOfObjectives < 0) return false;
1133  if(iNumberOfObjectives == 0) return true;
1134  if(objectiveValues == NULL) return false;
1135  int nSols = this->getSolutionNumber();
1136  if(optimization == NULL) return false;
1137  if(nSols <= 0) return false;
1138  if(optimization == NULL) return false;
1139  if(optimization->solution == NULL ||
1140  solIdx < 0 || solIdx >= nSols) return false;
1141  if(optimization->solution[solIdx] == NULL){
1142  optimization->solution[solIdx] = new OptimizationSolution();
1143  }
1144  if(optimization->solution[solIdx]->objectives == NULL){
1146  }
1147  if(optimization->solution[solIdx]->objectives->values == NULL){
1149  }
1150  optimization->solution[solIdx]->objectives->values->numberOfObj = iNumberOfObjectives;
1151  for(int i = 0; i < iNumberOfObjectives; i++){
1152  optimization->solution[solIdx]->objectives->values->obj.push_back( new ObjValue());
1153  optimization->solution[solIdx]->objectives->values->obj[i]->idx = -(i+1);
1154  optimization->solution[solIdx]->objectives->values->obj[i]->value = objectiveValues[i];
1155  }
1156  return true;
1157 }//setObjectiveValues
1158 
1159 bool OSResult::setNumberOfDualVariableValues(int solIdx, int numberOfCon){
1160  int nSols = this->getSolutionNumber();
1161  int nCon = this->getConstraintNumber();
1162  if (numberOfCon <= 0 || numberOfCon > nCon) return false;
1163  if(optimization == NULL) return false;
1164  if(nSols <= 0) return false;
1165  if(optimization->solution == NULL ||
1166  solIdx < 0 || solIdx >= nSols) return false;
1167  if(optimization->solution[solIdx] == NULL){
1168  optimization->solution[solIdx] = new OptimizationSolution();
1169  }
1170  if(optimization->solution[solIdx]->constraints == NULL){
1172  }
1173  if(optimization->solution[solIdx]->constraints->values == NULL){
1174  optimization->solution[solIdx]->constraints->values = new DualVariableValues();
1175  }
1176  optimization->solution[solIdx]->constraints->values->numberOfCon = numberOfCon;
1177 // optimization->solution[solIdx]->constraints->values->con = new DualVarValue*[numberOfCon];
1178 
1179  return true;
1180 }//setNumberOfDualVariableValues
1181 
1182 
1183 
1184 bool OSResult::setDualVariableValues(int solIdx, double *lbValues, double *ubValues, int numberOfCon){
1185  int iNumberOfConstraints = numberOfCon;
1186  if(iNumberOfConstraints < 0) return false;
1187  if(iNumberOfConstraints == 0) return true;
1188  int nSols = this->getSolutionNumber();
1189  if(optimization == NULL) return false;
1190  if(nSols <= 0) return false;
1191  if(optimization == NULL) return false;
1192  if(optimization->solution == NULL ||
1193  solIdx < 0 || solIdx >= nSols) return false;
1194  if(optimization->solution[solIdx] == NULL){
1195  optimization->solution[solIdx] = new OptimizationSolution();
1196  }
1197  if(optimization->solution[solIdx]->constraints == NULL){
1199  }
1200  if(optimization->solution[solIdx]->constraints->dualValues == NULL){
1202  }
1203  if(lbValues == NULL && ubValues == NULL){
1204  //optimization->solution[solIdx]->constraints->dualValues->con = NULL;
1205  return true;
1206  }
1207  int iCons = 0;
1208  if(lbValues == NULL){
1209  for(int i = 0; i < iNumberOfConstraints; i++){
1210  if(ubValues[i] != 0) iCons++;
1211  }
1212  }
1213  else if(ubValues == NULL){
1214  for(int i = 0; i < iNumberOfConstraints; i++){
1215  if(lbValues[i] != 0) iCons++;
1216  }
1217  }
1218  else{
1219  for(int i = 0; i < iNumberOfConstraints; i++){
1220  if(lbValues[i] != 0 || ubValues[i] != 0) iCons++;
1221  }
1222  }
1223 
1224  //optimization->solution[solIdx]->constraints->dualValues->con = new DualVarValue*[iCons];
1225  optimization->solution[solIdx]->constraints->dualValues->numberOfCon = numberOfCon;
1226  for(int i = 0; i < iCons; i++) optimization->solution[solIdx]->constraints->dualValues->con.push_back( new DualVarValue());
1227  int j = 0;
1228  if(lbValues == NULL){
1229  for(int i = 0; i < iNumberOfConstraints; i++){
1230  if(ubValues[i] != 0){
1231  optimization->solution[solIdx]->constraints->dualValues->con[j]->idx = i;
1233  optimization->solution[solIdx]->constraints->dualValues->con[j]->ubValue = ubValues[i];
1234  j++;
1235  }
1236  }
1237  }
1238  else if(ubValues == NULL){
1239  for(int i = 0; i < iNumberOfConstraints; i++){
1240  if(lbValues[i] != 0){
1241  optimization->solution[solIdx]->constraints->dualValues->con[j]->idx = i;
1242  optimization->solution[solIdx]->constraints->dualValues->con[j]->lbValue = lbValues[i];
1244  j++;
1245  }
1246  }
1247  }
1248  else{
1249  for(int i = 0; i < iNumberOfConstraints; i++){
1250  if(lbValues[i] != 0 || ubValues[i] != 0){
1251  optimization->solution[solIdx]->constraints->dualValues->con[j]->idx = i;
1252  optimization->solution[solIdx]->constraints->dualValues->con[j]->lbValue = lbValues[i];
1253  optimization->solution[solIdx]->constraints->dualValues->con[j]->ubValue = ubValues[i];
1254  j++;
1255  }
1256  }
1257  }
1258  return true;
1259 }//setDualVariableValues
1260 
1261 bool OSResult::setDualVariableValues(int solIdx, double *y, int numberOfCon){
1262  int iNumberOfConstraints = numberOfCon;
1263  if(iNumberOfConstraints < 0) return false;
1264  if(iNumberOfConstraints == 0) return true;
1265  int nSols = this->getSolutionNumber();
1266  if(optimization == NULL) return false;
1267  if(nSols <= 0) return false;
1268  if(optimization == NULL) return false;
1269  if(optimization->solution == NULL ||
1270  solIdx < 0 || solIdx >= nSols) return false;
1271  if(optimization->solution[solIdx] == NULL){
1272  optimization->solution[solIdx] = new OptimizationSolution();
1273  }
1274  if(optimization->solution[solIdx]->constraints == NULL){
1276  }
1277  if(optimization->solution[solIdx]->constraints->dualValues == NULL){
1279  }
1280  if(y == NULL){
1281  optimization->solution[solIdx]->constraints->dualValues = NULL;
1282  return true;
1283  }
1284  optimization->solution[solIdx]->constraints->dualValues->numberOfCon = numberOfCon;
1285  for(int i = 0; i < iNumberOfConstraints; i++){
1286  optimization->solution[solIdx]->constraints->dualValues->con.push_back( new DualVarValue());
1287  optimization->solution[solIdx]->constraints->dualValues->con[i]->idx = i;
1288  optimization->solution[solIdx]->constraints->dualValues->con[i]->value = y[i];
1289  }
1290  return true;
1291 }//setDualVariableValues
1292 
1293 bool OSResult::setConstraintValues(int solIdx, double *dualVarValues, int numberOfCon){
1294  int iNumberOfConstraints = numberOfCon;
1295  if(iNumberOfConstraints <= 0) return false;
1296  int nSols = this->getSolutionNumber();
1297  if(optimization == NULL) return false;
1298  if(nSols <= 0) return false;
1299  if(optimization == NULL) return false;
1300  if(optimization->solution == NULL ||
1301  solIdx < 0 || solIdx >= nSols) return false;
1302  if(optimization->solution[solIdx] == NULL){
1303  optimization->solution[solIdx] = new OptimizationSolution();
1304  }
1305  if(optimization->solution[solIdx]->constraints == NULL){
1307  }
1308  if(optimization->solution[solIdx]->constraints->dualValues == NULL){
1310  }
1311  if(dualVarValues == NULL){
1312  optimization->solution[solIdx]->constraints->dualValues = NULL;
1313  return true;
1314  }
1315  //optimization->solution[solIdx]->constraints->dualValues->con = new ConValue*[ iNumberOfConstraints];
1316  optimization->solution[solIdx]->constraints->dualValues->numberOfCon = numberOfCon;
1317  for(int i = 0; i < iNumberOfConstraints; i++){
1318  optimization->solution[solIdx]->constraints->dualValues->con.push_back( new DualVarValue());
1319  //optimization->solution[solIdx]->constraints->dualValues->con[i] = new ConValue();
1320  optimization->solution[solIdx]->constraints->dualValues->con[i]->idx = i;
1321  optimization->solution[solIdx]->constraints->dualValues->con[i]->value = dualVarValues[i];
1322  }
1323  return true;
1324 }//setConstraintValues
1325 
1326 
OptimizationSolutionStatus * status
status is a pointer to an OptimizationSolutionStatus object associated with this optimization solutio...
Definition: OSResult.h:2283
double * values
int getObjectiveNumber()
Get objective number.
Definition: OSResult.cpp:2013
VariableValues()
Default constructor.
Definition: OSResult.cpp:428
~OSResult()
Class destructor.
Definition: OSResult.cpp:1402
std::string getGeneralMessage()
Get the general message.
Definition: OSResult.cpp:1520
GeneralStatus * getGeneralStatus()
Get the general status.
Definition: OSResult.cpp:1473
int m_iVariableNumber
m_iVariableNumber holds the variable number.
Definition: OSResult.h:2614
OtherConstraintResult ** other
a pointer to an array of other pointer objects for constraint functions
Definition: OSResult.h:1879
The TimingInformation Class.
Definition: OSResult.h:604
bool setGeneralStatusDescription(std::string description)
Set the general status description.
bool setSolutionStatus(int solIdx, std::string type, std::string description)
Set the [i]th optimization solution status, where i equals the given solution index.
int numberOfVar
the number of variable values that are in the solution
Definition: OSResult.h:907
std::string getGeneralStatusType()
Get the general status type, which can be: success, error, warning.
Definition: OSResult.cpp:1479
double value
value is a double that holds the value of the entity
Definition: OSGeneral.h:638
std::string getSolutionStatusType(int solIdx)
Get the [i]th optimization solution status type, where i equals the given solution index...
Definition: OSResult.cpp:2051
bool setDualVariableValues(int solIdx, double *lbValues, double *ubValues, int n)
Set the [i]th optimization solution&#39;s dual variable values, where i equals the given solution index...
Definition: OSResult.cpp:1184
ObjectiveValues()
Default constructor.
Definition: OSResult.cpp:638
~ObjectiveSolution()
Class destructor.
Definition: OSResult.cpp:744
int numberOfOtherObjectiveResults
the number of types of objective function results other than the basic objective function values ...
Definition: OSResult.h:1544
TimingInformation * timingInformation
a pointer to the TimingInformation class
Definition: OSResult.h:679
Time()
Default constructor.
Definition: OSResult.cpp:150
The OptimizationResult Class.
Definition: OSResult.h:2473
ObjValue ** obj
obj is a pointer to an array of ObjValue objects that give an index and objective function value for ...
Definition: OSResult.h:1344
bool setServiceName(std::string serviceName)
Set service name.
int idx
idx is the index on variable in the solution
Definition: OSResult.h:852
The ObjectiveValues Class.
Definition: OSResult.h:1332
OtherObjResult()
Default constructor.
Definition: OSResult.cpp:667
bool setVariableNumber(int variableNumber)
Set the variable number.
Definition: OSResult.cpp:4712
DualVarValue ** con
con is a vector of DualVarValue objects that give an index and dual variable value for each constrain...
Definition: OSResult.h:1666
DualVariableValues * dualValues
a pointer to an array of DualVariableValues objects
Definition: OSResult.h:1871
~GeneralResult()
Class destructor.
Definition: OSResult.cpp:142
std::string description
Further description on the timer used.
Definition: OSResult.h:246
~JobResult()
Class destructor.
Definition: OSResult.cpp:322
bool setNumberOfPrimalVariableValues(int solIdx, int n)
Set the [i]th optimization solution&#39;s number of primal variable values, where i equals the given solu...
Definition: OSResult.cpp:4933
std::string message
a message associated with this solution
Definition: OSResult.h:2286
std::vector< IndexValuePair * > getOptimalPrimalVariableValues(int solIdx)
Get one solution of optimal primal variable values.
Definition: OSResult.cpp:2215
std::string unit
The unit of time (tick/millisecond/second/minute/hour/day/week/month/year)
Definition: OSResult.h:240
bool setAnOtherVariableResult(int solIdx, int otherIdx, std::string name, std::string description, int *indexes, std::string *s, int n)
Set the [i]th optimization solution&#39;s other (non-standard/solver specific)variable-related results...
Definition: OSResult.cpp:1080
JobResult * job
job holds the fourth child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2576
DualVarValue()
Default constructor.
Definition: OSResult.cpp:772
~OptimizationSolution()
Class destructor.
Definition: OSResult.cpp:1238
ServiceResult()
Default constructor.
Definition: OSResult.cpp:206
GeneralResult * general
general holds the first child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2561
ServiceResult * service
service holds the third child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2571
double value
the number of units
Definition: OSGeneral.h:932
ObjectiveSolution()
Default constructor.
Definition: OSResult.cpp:732
bool setTime(double time)
Set time.
Definition: OSResult.cpp:4482
GeneralResult()
Default constructor.
Definition: OSResult.cpp:125
The OptimizationSolution Class.
Definition: OSResult.h:2263
The ConstraintSolution Class.
Definition: OSResult.h:1860
bool setGeneralStatus(GeneralStatus *status)
Set the general status.
Definition: OSResult.cpp:4060
OptimizationResult * optimization
optimization holds the fifth child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2581
DualVariableValues()
Default constructor.
Definition: OSResult.cpp:793
SystemResult()
Default constructor.
Definition: OSResult.cpp:159
SystemResult * system
system holds the second child of the OSResult specified by the OSrL Schema.
Definition: OSResult.h:2566
std::vector< IndexValuePair * > getOptimalDualVariableValues(int solIdx)
Get one solution of optimal dual variable values.
Definition: OSResult.cpp:3504
OtherVariableResult()
Default constructor.
Definition: OSResult.cpp:524
bool setConstraintValues(int solIdx, double *constraintValues, int n)
Set the [i]th optimization solution&#39;s constraint values, where i equals the given solution index...
Definition: OSResult.cpp:1293
bool setServiceURI(std::string serviceURI)
Set service uri.
std::string description
a brief description of the type of result
Definition: OSResult.h:1150
bool setObjectiveNumber(int objectiveNumber)
Set the objective number.
Definition: OSResult.cpp:4721
~OtherVariableResult()
Class destructor.
Definition: OSResult.cpp:543
bool setInstanceName(std::string instanceName)
Set instance name.
bool setNumberOfObjectiveValues(int solIdx, int n)
Set the [i]th optimization solution&#39;s number of objective values, where i equals the given solution i...
Definition: OSResult.cpp:5754
double getTimeValue()
Get the time measurement.
Definition: OSResult.cpp:1987
The ServiceResult Class.
Definition: OSResult.h:415
bool setTimeNumber(int timeNumber)
Set the number of time measurements.
Definition: OSResult.cpp:4560
OSResult()
Default constructor.
Definition: OSResult.cpp:1382
~VariableSolution()
Class destructor.
Definition: OSResult.cpp:584
~DualVarValue()
Class destructor.
Definition: OSResult.cpp:785
~GeneralStatus()
Class destructor.
Definition: OSResult.cpp:62
~OtherConstraintResult()
Class destructor.
Definition: OSResult.cpp:860
~OtherObjResult()
Class destructor.
Definition: OSResult.cpp:678
The ObjValue Class.
Definition: OSResult.h:1281
ObjectiveSolution * objectives
objectives holds the solution information for the objectives
Definition: OSResult.h:2300
OtherObjectiveResult()
Default constructor.
Definition: OSResult.cpp:686
static char * j
Definition: OSdtoa.cpp:3622
int numberOfVar
the number of variables which have values for this particular type of result
Definition: OSResult.h:1131
int m_iObjectiveNumber
m_iObjectiveNumber holds the objective number.
Definition: OSResult.h:2619
std::string getGeneralStatusDescription()
Get the general status description.
Definition: OSResult.cpp:1486
~OtherConResult()
Class destructor.
Definition: OSResult.cpp:833
The OptimizationSolutionStatus Class.
Definition: OSResult.h:792
OtherConResult ** con
Definition: OSResult.h:1805
bool setSolutionNumber(int number)
set the number of solutions.
Definition: OSResult.cpp:4740
double * m_mdPrimalValues
m_mdPrimalValues a vector of primal variables.
Definition: OSResult.h:2634
~ConstraintSolution()
Class destructor.
Definition: OSResult.cpp:901
std::string getServiceName()
Get service name.
Definition: OSResult.cpp:1526
std::string message
any general message associated with the optimization
Definition: OSResult.h:276
OtherVarResult ** var
Definition: OSResult.h:1162
OtherVarResult()
Default constructor.
Definition: OSResult.cpp:504
std::string getSolutionMessage(int solIdx)
Get the [i]th optimization solution message, where i equals the given solution index.
Definition: OSResult.cpp:2140
int numberOfCon
record the number of constraints for which values are given
Definition: OSResult.h:1660
#define OSNAN
Definition: OSParameters.h:106
The SystemResult Class.
Definition: OSResult.h:349
double ubValue
ubValue is the value of dual variable on the constraint indexed by idx if the constraint is at its up...
Definition: OSResult.h:928
VarValue ** var
a vector of VarValue objects, there will be one for each variable in the solution ...
Definition: OSResult.h:912
VariableSolution * variables
variables holds the solution information for the variables
Definition: OSResult.h:2291
bool setObjectiveValues(int solIdx, double *objectiveValues, int n)
Set the [i]th optimization solution&#39;s objective values, where i equals the given solution index...
Definition: OSResult.cpp:1130
std::string getJobID()
Get the job id.
Definition: OSResult.cpp:1544
bool setNumberOfOtherVariableResults(int solIdx, int numberOfOtherVariableResults)
Set the [i]th optimization solution&#39;s other (non-standard/solver specific) variable-related results...
Definition: OSResult.cpp:5236
~OptimizationSolutionStatus()
Class destructor.
Definition: OSResult.cpp:390
ObjValue()
Default constructor.
Definition: OSResult.cpp:618
OptimizationResult()
Default constructor.
Definition: OSResult.cpp:1337
int numberOfSolutions
numberOfSolutions is the number of objective functions reported.
Definition: OSResult.h:2480
std::string name
the name of the result the user is defining
Definition: OSResult.h:1139
double lbValue
lbValue is the value of dual variable on the constraint indexed by idx if the constraint is at its lo...
Definition: OSResult.h:921
bool setPrimalVariableValues(int solIdx, double *x, int n)
Set the [i]th optimization solution&#39;s primal variable values, where i equals the given solution index...
Definition: OSResult.cpp:1028
int numberOfTimes
The number of elements in the time array.
Definition: OSResult.h:612
~OtherVarResult()
Class destructor.
Definition: OSResult.cpp:515
VariableValues * values
a pointer to a VariableValues object
Definition: OSResult.h:1227
GeneralStatus * generalStatus
a pointer to the GeneralStatus class
Definition: OSResult.h:272
int idx
the index of a variable in the solution
Definition: OSResult.h:1070
The GeneralResult Class.
Definition: OSResult.h:266
The VariableValues Class.
Definition: OSResult.h:901
void fint fint fint fint fint fint fint fint fint fint real real real real real real real real * s
int getSolutionNumber()
get the number of solutions.
Definition: OSResult.cpp:2033
bool setGeneralMessage(std::string message)
Set the general message.
int idx
idx holds the index of an entity (such as a variable, constraint, objective) that is part of a sparse...
Definition: OSGeneral.h:635
std::string getInstanceName()
Get instance name.
Definition: OSResult.cpp:1538
TimeMeasurement ** time
An array of time measurements.
Definition: OSResult.h:618
~VariableValues()
Class destructor.
Definition: OSResult.cpp:438
std::string type
the type of solution status
Definition: OSResult.h:800
bool setGeneralStatusType(std::string type)
Set the general status type, which can be: success, error, warning.
int targetObjectiveIdx
the index of the objective function for which we are reporting solution information ...
Definition: OSResult.h:2270
std::string type
the type of status
Definition: OSResult.h:114
~ObjectiveValues()
Class destructor.
Definition: OSResult.cpp:649
~ServiceResult()
Class destructor.
Definition: OSResult.cpp:220
~VarValue()
Class destructor.
Definition: OSResult.cpp:419
ConstraintSolution()
Default constructor.
Definition: OSResult.cpp:889
The VariableSolution Class.
Definition: OSResult.h:1217
bool setNumberOfDualVariableValues(int solIdx, int n)
Set the [i]th optimization solution&#39;s number of dual variable values, where i equals the given soluti...
Definition: OSResult.cpp:6219
OptimizationSolution ** solution
solution is an array of pointers to OptimizationSolution objects
Definition: OSResult.h:2500
double * m_mdDualValues
m_mdDualValues a vector of dual variables.
Definition: OSResult.h:2639
ConstraintSolution * constraints
constraints holds the solution information for the constraints
Definition: OSResult.h:2295
~OptimizationResult()
Class destructor.
Definition: OSResult.cpp:1351
ObjectiveValues * values
a pointer to an array of ObjectiveValues objects
Definition: OSResult.h:1547
std::string instanceName
the name of the instance that was solved
Definition: OSResult.h:290
bool setConstraintNumber(int constraintNumber)
Set the constraint number.
Definition: OSResult.cpp:4731
VarValue()
Default constructor.
Definition: OSResult.cpp:408
bool setSolutionObjectiveIndex(int solIdx, int objectiveIdx)
Set the [i]th optimization solution&#39;s objective index, where i equals the given solution index...
Definition: OSResult.cpp:990
std::string serviceName
the serviceName is the name of the solver service that did the optimization
Definition: OSResult.h:286
~Time()
Class destructor.
Definition: OSResult.cpp:163
int numberOfConstraints
numberOfConstrants is the number of constraint functions reported in the solution.
Definition: OSResult.h:2495
std::string getSolutionStatusDescription(int solIdx)
Get the [i]th optimization solution status description, where i equals the given solution index...
Definition: OSResult.cpp:2062
std::string description
a description of the solution status type
Definition: OSResult.h:803
double value
Definition: OSResult.h:860
int idx
idx is the index on a constraint
Definition: OSResult.h:1603
OtherVariableResult ** other
a pointer to an array of other pointer objects for variables
Definition: OSResult.h:1238
The JobResult Class.
Definition: OSResult.h:659
VariableSolution()
Default constructor.
Definition: OSResult.cpp:571
int numberOfObj
record the number of objective rows for which values are given
Definition: OSResult.h:1338
std::string serviceURI
the serviceURI is the URI of the solver service that did the optimization
Definition: OSResult.h:281
bool setJobID(std::string jobID)
Set job id.
VarValue Class.
Definition: OSResult.h:847
The DualVariableValues Class.
Definition: OSResult.h:1654
TimingInformation()
Default constructor.
Definition: OSResult.cpp:275
OtherObjResult ** obj
Definition: OSResult.h:1481
OtherObjectiveResult ** other
a pointer to an array of other pointer objects for objective functions
Definition: OSResult.h:1555
int numberOfVariables
numberOfVariables is the number of variables reported in the solution.
Definition: OSResult.h:2485
int getNumberOfOtherVariableResults(int solIdx)
Get numberOfOtherVariableResult.
Definition: OSResult.cpp:2456
fint nt
int numberOfOtherConstraintResults
the number of types of constraint function results other than the basic constraint function values ...
Definition: OSResult.h:1868
bool addTimingInformation(std::string type, std::string category, std::string unit, std::string description, double value)
Add timing information.
Definition: OSResult.cpp:4487
std::string category
The category of time (total/input/preprocessing/optimization/postprocessing/output/other) ...
Definition: OSResult.h:234
JobResult()
Default constructor.
Definition: OSResult.cpp:302
double value
The time measurement.
Definition: OSResult.h:252
~ObjValue()
Class destructor.
Definition: OSResult.cpp:629
~DualVariableValues()
Class destructor.
Definition: OSResult.cpp:804
int getTimeNumber()
Get the number of time measurements.
Definition: OSResult.cpp:1995
The Time Class.
Definition: OSResult.h:221
std::string getServiceURI()
Get service uri.
Definition: OSResult.cpp:1532
int numberOfOtherVariableResults
the number of types of variable results other than the value of the variable
Definition: OSResult.h:1224
int idx
idx is the index on an objective function
Definition: OSResult.h:1286
std::string type
The type of timer used (cpuTime/elapsedTime/other)
Definition: OSResult.h:228
OtherConstraintResult()
Default constructor.
Definition: OSResult.cpp:842
double value
the value of the objective indexed by idx
Definition: OSResult.h:1292
GeneralStatus()
Default constructor.
Definition: OSResult.cpp:51
int m_iNumberOfOtherVariableResults
m_iNumberOfOtherVariableResults holds the number of OtherVariableResult objects.
Definition: OSResult.h:2629
std::string jobID
the jobID is the ID associated with the solution of this instance
Definition: OSResult.h:295
OptimizationSolution()
Default constructor.
Definition: OSResult.cpp:1219
std::string value
value holds a general value associated with a variable, for example, rather than the value of a varia...
Definition: OSResult.h:1081
void fint * n
OptimizationSolutionStatus * getSolutionStatus(int solIdx)
Get the [i]th optimization solution status, where i equals the given solution index.
Definition: OSResult.cpp:2041
The DualVarValue Class.
Definition: OSResult.h:1598
int getVariableNumber()
Get variable number.
Definition: OSResult.cpp:2003
int m_iConstraintNumber
m_iConstraintNumber holds the constraint number.
Definition: OSResult.h:2624
~TimingInformation()
Class destructor.
Definition: OSResult.cpp:285
double value
value of dual variable on the constraint indexed by idx
Definition: OSResult.h:1611
~SystemResult()
Class destructor.
Definition: OSResult.cpp:173
OtherVarResult Class.
Definition: OSResult.h:1065
The GeneralStatus Class.
Definition: OSResult.h:105
OtherConResult()
Default constructor.
Definition: OSResult.cpp:822
int numberOfObjectives
numberOfObjectives is the number of objective functions reported in the solution. ...
Definition: OSResult.h:2490
int getConstraintNumber()
Get constraint number.
Definition: OSResult.cpp:2023
The OtherVariableResult Class.
Definition: OSResult.h:1124
The ObjectiveSolution Class.
Definition: OSResult.h:1537
void fint fint fint real fint real * x
OptimizationSolutionStatus()
Default constructor.
Definition: OSResult.cpp:378
std::string description
the description of the status
Definition: OSResult.h:117
~OtherObjectiveResult()
Class destructor.
Definition: OSResult.cpp:704