00001
00018 #ifndef OSRESULT_H
00019 #define OSRESULT_H
00020
00021 #include <string>
00022 #include <vector>
00023 #include "OSDataStructures.h"
00024
00025
00037 class GeneralSubstatus {
00038
00039 public:
00040
00042 std::string name;
00043
00045 std::string description;
00046
00051 GeneralSubstatus();
00056 ~GeneralSubstatus();
00057
00058 };
00059
00060
00072 class GeneralStatus {
00073
00074 public:
00075
00077 int numberOfSubstatuses;
00078
00080 std::string type;
00081
00083 std::string description;
00084
00086 std::vector<GeneralSubstatus*> substatus;
00087
00092 GeneralStatus();
00097 ~GeneralStatus();
00098
00099 };
00100
00101
00113 class GeneralResult{
00114 public:
00115
00117 GeneralStatus *generalStatus;
00118
00122 std::string serviceURI;
00123
00127 std::string serviceName;
00128
00130 std::string instanceName;
00131
00135 std::string jobID;
00136
00140 std::string time;
00141
00143 std::string message;
00144
00149 GeneralResult();
00154 ~GeneralResult();
00155 };
00156
00157
00169 class SystemResult{
00170 public:
00171
00176 SystemResult();
00181 ~SystemResult();
00182 };
00183
00184
00196 class ServiceResult{
00197 public:
00198
00203 ServiceResult();
00208 ~ServiceResult();
00209 };
00210
00211
00223 class Time{
00224 public:
00225
00230 std::string type;
00231
00236 std::string category;
00237
00242 std::string unit;
00243
00248 std::string description;
00249
00254 double value;
00255
00260 Time();
00265 ~Time();
00266 };
00267
00268
00280 class TimingInformation{
00281 public:
00282
00287 Time** time;
00288
00293 int numberOfTimes;
00294
00299 TimingInformation();
00304 ~TimingInformation();
00305 };
00306
00307
00319 class JobResult{
00320 public:
00321
00322 TimingInformation* timingInformation;
00327 JobResult();
00332 ~JobResult();
00333 };
00334
00335
00336
00337
00349 class OptimizationSolutionSubstatus {
00350 public:
00351
00353 std::string namee;
00354
00356 std::string description;
00357
00358
00362 OptimizationSolutionSubstatus();
00367 ~OptimizationSolutionSubstatus();
00368
00369 };
00370
00371
00383 class OptimizationSolutionStatus {
00384 public:
00385
00387 int numberOfSubstatuses;
00388
00390 std::string type;
00391
00393 std::string description;
00394
00396 std::vector<OptimizationSolutionSubstatus*> substatus;
00397
00401 OptimizationSolutionStatus();
00406 ~OptimizationSolutionStatus();
00407
00408 };
00409
00410
00422 class VarValue{
00423 public:
00424
00426 int idx;
00427
00428
00429
00430
00431 double value;
00432
00437 VarValue();
00442 ~VarValue();
00443
00444 };
00445
00446
00457 class VariableValues{
00458 public:
00459
00462 int numberOfVar;
00463
00467 std::vector<VarValue*> var;
00468
00469
00474 VariableValues();
00475
00480 ~VariableValues();
00481
00482 };
00483
00484
00496 class VarStringValue{
00497 public:
00498
00500 int idx;
00501
00502
00503
00504
00505 std::string value;
00506
00511 VarStringValue();
00512
00517 ~VarStringValue();
00518
00519 };
00520
00521
00532 class VariableStringValues{
00533 public:
00534
00537 int numberOfVar;
00538
00542 std::vector<VarStringValue*> var;
00543
00544
00549 VariableStringValues();
00550
00555 ~VariableStringValues();
00556
00557 };
00558
00559
00570 class OtherVarResult {
00571 public:
00572
00574 int idx;
00575
00582 std::string value;
00583
00588 OtherVarResult();
00593 ~OtherVarResult();
00594
00595 };
00596
00597
00598
00610 class OtherVariableResult {
00611 public:
00612
00616 int numberOfVar;
00617
00621 std::string value;
00622
00624 std::string name;
00625
00627 std::string description;
00628
00629
00630
00631
00632
00633 std::vector<OtherVarResult*> var;
00634
00639 OtherVariableResult();
00640
00645 ~OtherVariableResult();
00646
00647 };
00648
00649
00661 class VariableSolution{
00662 public:
00663
00667 int numberOfOtherVariableResults;
00668
00670 VariableValues *values;
00671
00673 VariableStringValues *valuesString;
00674
00675
00679 OtherVariableResult** other;
00680
00685 VariableSolution();
00686
00691 ~VariableSolution();
00692
00693 };
00694
00695
00707 class ObjValue {
00708 public:
00709
00711 int idx;
00712
00714 double value;
00715
00720 ObjValue();
00721
00726 ~ObjValue();
00727 };
00728
00739 class ObjectiveValues {
00740 public:
00741
00744 int numberOfObj;
00745
00750 std::vector<ObjValue*> obj;
00751
00756 ObjectiveValues();
00757
00762 ~ObjectiveValues();
00763
00764 };
00765
00766
00778 class OtherObjResult {
00779 public:
00780
00782 int idx;
00783
00784
00788 std::string value;
00789
00794 OtherObjResult();
00795
00800 ~OtherObjResult();
00801
00802 };
00803
00804
00805
00806
00818 class OtherObjectiveResult {
00819 public:
00820
00824 int numberOfObj;
00825
00829 std::string value;
00830
00831
00833 std::string name;
00834
00836 std::string description;
00837
00838
00839
00840
00841
00842 std::vector<OtherObjResult*> obj;
00843
00848 OtherObjectiveResult();
00849
00854 ~OtherObjectiveResult();
00855
00856 };
00857
00858
00859
00871 class ObjectiveSolution {
00872 public:
00873
00877 int numberOfOtherObjectiveResults;
00878
00880 ObjectiveValues *values;
00881
00885 OtherObjectiveResult** other;
00886
00891 ObjectiveSolution();
00892
00897 ~ObjectiveSolution();
00898
00899 };
00900
00901
00902
00913 class DualVarValue {
00914 public:
00915
00917 int idx;
00918
00923
00924
00925
00930
00931
00935 double value;
00936
00941 DualVarValue();
00942
00947 ~DualVarValue();
00948
00949 };
00950
00951
00952
00963 class DualVariableValues {
00964 public:
00965
00968 int numberOfCon;
00969
00974 std::vector<DualVarValue*> con;
00975
00980 DualVariableValues();
00981
00986 ~DualVariableValues();
00987
00988 };
00989
00990
01002 class OtherConResult {
01003 public:
01004
01006 int idx;
01007
01013 std::string value;
01014
01019 OtherConResult();
01020
01025 ~OtherConResult();
01026
01027 };
01028
01029
01030
01031
01032
01044 class OtherConstraintResult {
01045 public:
01046
01050 int numberOfCon;
01051
01055 std::string value;
01056
01058 std::string name;
01059
01061 std::string description;
01062
01063
01064
01065
01066
01067
01068 std::vector<OtherConResult*> con;
01069
01074 OtherConstraintResult();
01075
01080 ~OtherConstraintResult();
01081
01082 };
01083
01084
01085
01086
01098 class ConstraintSolution {
01099
01100 public:
01101
01105 int numberOfOtherConstraintResults;
01106
01108 DualVariableValues *dualValues;
01109
01113 OtherConstraintResult** other;
01114
01119 ConstraintSolution();
01120
01125 ~ConstraintSolution();
01126
01127 };
01128
01129
01130
01131
01143 class OtherSolutionResult {
01144 public:
01145
01147 std::string name;
01148
01152 std::string category;
01153
01155 std::string description;
01156
01159 int numberOfItems;
01160
01163 std::string *item;
01164
01169 OtherSolutionResult();
01170
01175 ~OtherSolutionResult();
01176
01177 };
01178
01179
01180
01181
01193 class OtherSolutionResults {
01194 public:
01195
01197 int numberOfOtherSolutionResults;
01198
01202 OtherSolutionResult **otherSolutionResult;
01203
01208 OtherSolutionResults();
01209
01214 ~OtherSolutionResults();
01215
01216 };
01217
01218
01219
01220
01232 class OptimizationSolution{
01233 public:
01234
01238 int targetObjectiveIdx;
01239
01241 int numberOfOtherResults;
01242
01246 OptimizationSolutionStatus *status;
01247
01249 std::string message;
01250
01254 VariableSolution *variables;
01255
01259 ObjectiveSolution *objectives;
01260
01264 ConstraintSolution *constraints;
01265
01269 OtherSolutionResults *otherSolutionResults;
01270
01275 OptimizationSolution();
01276
01281 ~OptimizationSolution();
01282
01283 };
01284
01285
01297 class OptimizationResult{
01298 public:
01299
01303 int numberOfVariables;
01304
01308 int numberOfObjectives;
01309
01313 int numberOfConstraints;
01314
01318 int numberOfSolutions;
01319
01323 OptimizationSolution **solution;
01324
01329 OptimizationResult();
01330
01335 ~OptimizationResult();
01336
01337 };
01338
01339
01340
01351 class OSResult{
01352
01353 public:
01354
01358 GeneralResult *general;
01359
01363 SystemResult *system;
01364
01368 ServiceResult *service;
01369
01373 JobResult *job;
01374
01378 OptimizationResult *optimization;
01379
01384 OSResult();
01385
01390 ~OSResult();
01391 public:
01392
01396 int m_iVariableNumber;
01397
01401 int m_iObjectiveNumber;
01402
01406 int m_iConstraintNumber;
01407
01411 int m_iNumberOfOtherVariableResults;
01412
01416 double *m_mdPrimalValues;
01417
01421 double *m_mdDualValues;
01422
01423
01424 std::vector<IndexValuePair*> primalVals;
01425
01426 std::vector<IndexValuePair*> dualVals;
01427
01428
01429
01430
01431 public:
01432
01438 GeneralStatus* getGeneralStatus();
01439
01446 std::string getGeneralStatusType();
01447
01453 std::string getGeneralStatusDescription();
01454
01460 std::string getServiceName();
01461
01467 std::string getServiceURI();
01468
01474 std::string getInstanceName();
01475
01481 std::string getJobID();
01482
01488 std::string getGeneralMessage();
01489
01495 int getTimeNumber();
01496
01503 double getTimeValue();
01504
01511 std::vector<IndexValuePair*> getOptimalPrimalVariableValues(int solIdx);
01512
01520 double getOptimalObjValue(int objIdx, int solIdx);
01521
01528 std::vector<IndexValuePair*> getOptimalDualVariableValues(int solIdx);
01529
01530
01531
01540 OptimizationSolutionStatus* getSolutionStatus( int solIdx);
01541
01551 std::string getSolutionStatusType(int solIdx);
01552
01559 std::string getSolutionStatusDescription(int solIdx);
01560
01567 std::string getSolutionMessage(int solIdx);
01568
01569
01570
01571
01577 int getVariableNumber();
01578
01584 int getObjectiveNumber();
01585
01591 int getConstraintNumber();
01592
01598 int getSolutionNumber();
01599
01605 int getNumberOfOtherVariableResults( int solIdx);
01606
01607
01613 int getAnOtherVariableResultNumberOfVar(int solIdx, int iOther);
01614
01615
01616
01617
01618
01625 bool setGeneralStatus(GeneralStatus *status);
01626
01634 bool setGeneralStatusType(std::string type);
01635
01642 bool setGeneralStatusDescription(std::string description);
01643
01650 bool setGeneralMessage(std::string message);
01651
01658 bool setServiceName(std::string serviceName);
01659
01666 bool setServiceURI(std::string serviceURI);
01667
01674 bool setInstanceName(std::string instanceName);
01675
01682 bool setJobID(std::string jobID);
01683
01690 bool setTime(double time);
01691
01702 bool addTimingInformation(std::string type, std::string category,
01703 std::string unit, std::string description, double value);
01704
01711 bool setTimeNumber(int timeNumber);
01712
01719 bool setVariableNumber(int variableNumber);
01720
01727 bool setObjectiveNumber(int objectiveNumber);
01728
01735 bool setConstraintNumber(int constraintNumber);
01736
01749 bool setSolutionNumber(int number);
01750
01751
01764 bool setSolutionStatus(int solIdx, std::string type, std::string description);
01765
01778 bool setSolutionTargetObjectiveIdx(int solIdx, int objectiveIdx);
01779
01791 bool setSolutionMessage(int solIdx, std::string msg);
01792
01802 bool setNumberOfPrimalVariableValues(int solIdx, int n);
01803
01814 bool setPrimalVariableValuesSparse(int solIdx, std::vector<IndexValuePair*> x);
01815
01825 bool setPrimalVariableValuesDense(int solIdx, double *x);
01826
01843 bool setNumberOfOtherVariableResults(int solIdx, int numberOfOtherVariableResults);
01844
01862 bool setAnOtherVariableResultSparse(int solIdx, int otherIdx, std::string name, std::string value, std::string description, int *idx, std::string *s, int n);
01863
01879 bool setAnOtherVariableResultDense(int solIdx, int otherIdx, std::string name, std::string value, std::string description, std::string *s);
01880
01890 bool setNumberOfObjectiveValues(int solIdx, int n);
01891
01892
01908 bool setObjectiveValuesSparse(int solIdx, std::vector<IndexValuePair*> x);
01909
01924 bool setObjectiveValuesDense(int solIdx, double *objectiveValues);
01925
01935 bool setNumberOfDualVariableValues(int solIdx, int n);
01936
01937
01948 bool setDualVariableValuesSparse(int solIdx, std::vector<IndexValuePair*> x);
01949
01950
01959 bool setDualVariableValuesDense(int solIdx, double *y);
01960
01970 bool setConstraintValuesDense(int solIdx, double *constraintValues);
01971
01972
01973
01974 };
01975 #endif