00001
00017 #ifndef OSRESULT_H
00018 #define OSRESULT_H
00019
00020 #include <string>
00021 #include <vector>
00022
00023
00035 class GeneralStatus {
00036
00037 public:
00038
00040 std::string type;
00041
00043 std::string description;
00044
00045
00050 GeneralStatus();
00055 ~GeneralStatus();
00056
00057 };
00058
00059
00071 class ResultHeader{
00072 public:
00073
00075 GeneralStatus *generalStatus;
00076
00080 std::string serviceURI;
00081
00085 std::string serviceName;
00086
00088 std::string instanceName;
00089
00093 std::string jobID;
00094
00098 std::string time;
00099
00101 std::string message;
00102
00107 ResultHeader();
00112 ~ResultHeader();
00113 };
00114
00126 class VarValue{
00127 public:
00128
00130 int idx;
00131
00132
00133
00134
00135 double value;
00136
00141 VarValue();
00146 ~VarValue();
00147
00148 };
00149
00150
00161 class OtherVarResult {
00162 public:
00163
00165 int idx;
00166
00173 std::string value;
00174
00179 OtherVarResult();
00184 ~OtherVarResult();
00185
00186 };
00187
00188
00200 class OtherObjResult {
00201 public:
00202
00204 int idx;
00205
00206
00210 std::string value;
00211
00216 OtherObjResult();
00221 ~OtherObjResult();
00222
00223 };
00224
00225
00226
00238 class OtherConResult {
00239 public:
00240
00242 int idx;
00243
00249 std::string value;
00250
00255 OtherConResult();
00260 ~OtherConResult();
00261
00262 };
00263
00264
00265
00277 class ObjValue {
00278 public:
00279
00281 int idx;
00282
00284 double value;
00285
00290 ObjValue();
00295 ~ObjValue();
00296
00297 };
00298
00299
00300
00311 class ConValue{
00312 public:
00313
00315 int idx;
00316
00318 double value;
00319
00324 ConValue();
00329 ~ConValue();
00330
00331 };
00332
00333
00334
00345 class DualVarValue {
00346 public:
00347
00349 int idx;
00350
00355 double lbValue;
00356
00357
00362 double ubValue;
00363
00367 double value;
00368
00373 DualVarValue();
00378 ~DualVarValue();
00379
00380 };
00381
00382
00393 class VariableValues{
00394 public:
00395
00399 std::vector<VarValue*> var;
00400
00401
00406 VariableValues();
00407
00412 ~VariableValues();
00413
00414 };
00415
00416
00428 class OtherVariableResult {
00429 public:
00430
00432 std::string name;
00433
00435 std::string description;
00436
00437
00438
00439
00440
00441 std::vector<OtherVarResult*> var;
00446 OtherVariableResult();
00447
00452 ~OtherVariableResult();
00453
00454 };
00455
00456
00468 class OtherObjectiveResult {
00469 public:
00470
00472 std::string name;
00473
00475 std::string description;
00476
00477
00478
00479
00480
00481 std::vector<OtherObjResult*> obj;
00482
00487 OtherObjectiveResult();
00488
00493 ~OtherObjectiveResult();
00494
00495 };
00496
00497
00509 class OtherConstraintResult {
00510 public:
00511
00513 std::string name;
00514
00516 std::string description;
00517
00518
00519
00520
00521
00522
00523 std::vector<OtherConResult*> con;
00528 OtherConstraintResult();
00529
00534 ~OtherConstraintResult();
00535
00536 };
00537
00548 class ObjectiveValues {
00549 public:
00550
00555 std::vector<ObjValue*> obj;
00556
00561 ObjectiveValues();
00562
00567 ~ObjectiveValues();
00568
00569 };
00570
00571
00582 class ConstraintValues{
00583 public:
00584
00589 std::vector<ConValue*> con;
00590
00595 ConstraintValues();
00596
00601 ~ConstraintValues();
00602
00603 };
00604
00605
00616 class DualVariableValues {
00617 public:
00618
00619
00624 std::vector<DualVarValue*> con;
00625
00630 DualVariableValues();
00631
00636 ~DualVariableValues();
00637
00638 };
00639
00640
00641
00642
00654 class VariableSolution{
00655 public:
00656
00660 int numberOfOtherVariableResult;
00661
00663 VariableValues *values;
00664
00665
00669 OtherVariableResult **other;
00670
00675 VariableSolution();
00676
00681 ~VariableSolution();
00682
00683 };
00684
00685
00697 class ObjectiveSolution {
00698 public:
00699
00703 int numberOfOtherObjectiveResult;
00704
00706 ObjectiveValues *values;
00707
00711 OtherObjectiveResult **other;
00712
00717 ObjectiveSolution();
00718
00723 ~ObjectiveSolution();
00724
00725 };
00726
00727
00739 class ConstraintSolution {
00740
00741 public:
00742
00746 int numberOfOtherConstraintResult;
00747
00749 ConstraintValues *values;
00750
00752 DualVariableValues *dualValues;
00753
00757 OtherConstraintResult **other;
00758
00763 ConstraintSolution();
00764
00769 ~ConstraintSolution();
00770
00771 };
00772
00773
00785 class OptimizationSolutionStatus {
00786 public:
00787
00789 std::string type;
00790
00792 std::string description;
00793
00794
00798 OptimizationSolutionStatus();
00803 ~OptimizationSolutionStatus();
00804
00805 };
00806
00807
00808
00820 class OptimizationSolution{
00821 public:
00822
00826 int objectiveIdx;
00827
00831 OptimizationSolutionStatus *status;
00832
00834 std::string message;
00835
00839 VariableSolution *variables;
00840
00844 ObjectiveSolution *objectives;
00845
00849 ConstraintSolution *constraints;
00850
00851
00856 OptimizationSolution();
00861 ~OptimizationSolution();
00862
00863 };
00864
00865
00877 class OptimizationResult{
00878 public:
00879
00883 int numberOfVariables;
00884
00888 int numberOfObjectives;
00889
00893 int numberOfConstraints;
00894
00898 int numberOfSolutions;
00899
00903 OptimizationSolution **solution;
00904
00909 OptimizationResult();
00914 ~OptimizationResult();
00915
00916 };
00917
00928 class ResultData{
00929 public:
00930
00934 OptimizationResult *optimization;
00935
00940 ResultData();
00945 ~ResultData();
00946 };
00947
00948
00959 class OSResult{
00960
00961 public:
00966 OSResult();
00971 ~OSResult();
00975 ResultHeader *resultHeader;
00979 ResultData *resultData;
00980 public:
00981
00985 int m_iVariableNumber;
00986
00990 int m_iObjectiveNumber;
00991
00995 int m_iConstraintNumber;
00996
01000 int m_iNumberOfOtherVariableResult;
01001
01005 double *m_mdPrimalValues;
01006
01010 double *m_mdDualValues;
01011
01012
01013
01014
01015 public:
01016
01022 GeneralStatus* getGeneralStatus();
01023
01030 std::string getGeneralStatusType();
01031
01037 std::string getGeneralStatusDescription();
01038
01044 std::string getServiceName();
01045
01051 std::string getServiceURI();
01052
01058 std::string getInstanceName();
01059
01065 std::string getJobID();
01066
01072 std::string getGeneralMessage();
01073
01080 double* getOptimalPrimalVariableValues(int objIdx);
01081
01088 double* getOptimalDualVariableValues(int objIdx);
01089
01090
01091
01100 OptimizationSolutionStatus* getSolutionStatus( int solIdx);
01101
01111 std::string getSolutionStatusType(int solIdx);
01112
01119 std::string getSolutionStatusDescription(int solIdx);
01120
01127 std::string getSolutionMessage(int solIdx);
01128
01129
01130
01131
01137 int getVariableNumber();
01138
01144 int getObjectiveNumber();
01145
01151 int getConstraintNumber();
01152
01158 int getSolutionNumber();
01159
01165 int getNumberOfOtherVariableResult( int solIdx);
01166
01167
01168
01169
01170
01171
01178 bool setGeneralStatus(GeneralStatus *status);
01179
01187 bool setGeneralStatusType(std::string type);
01188
01195 bool setGeneralStatusDescription(std::string description);
01196
01203 bool setGeneralMessage(std::string message);
01204
01211 bool setServiceName(std::string serviceName);
01212
01219 bool setServiceURI(std::string serviceURI);
01220
01227 bool setInstanceName(std::string instanceName);
01228
01235 bool setJobID(std::string jobID);
01236
01237
01244 bool setVariableNumber(int variableNumber);
01245
01252 bool setObjectiveNumber(int objectiveNumber);
01253
01260 bool setConstraintNumber(int constraintNumber);
01261
01274 bool setSolutionNumber(int number);
01275
01276
01289 bool setSolutionStatus(int solIdx, std::string type, std::string description);
01290
01303 bool setSolutionObjectiveIndex(int solIdx, int objectiveIdx);
01304
01314 bool setPrimalVariableValues(int solIdx, double *x);
01315
01332 bool setNumberOfOtherVariableResult(int solIdx, int numberOfOtherVariableResult);
01333
01348 bool setAnOtherVariableResult(int solIdx, int otherIdx, std::string name, std::string description, std::string *s);
01349
01350
01365 bool setObjectiveValues(int solIdx, double *objectiveValues);
01366
01367
01379 bool setDualVariableValues(int solIdx, double* lbValues, double* ubValues);
01380
01390 bool setDualVariableValues(int solIdx, double *y);
01391
01401 bool setConstraintValues(int solIdx, double *constraintValues);
01402
01403
01404
01405 };
01406 #endif