00001
00016 #ifndef OSGENERAL_H
00017 #define OSGENERAL_H
00018
00019 #include "OSConfig.h"
00020 #include "OSParameters.h"
00021
00022 #include <string>
00023 #include <vector>
00024
00029 class GeneralFileHeader
00030 {
00031 public:
00032
00036 std::string name;
00037
00042 std::string source;
00043
00047 std::string description;
00048
00052 std::string fileCreator;
00053
00057 std::string licence;
00058
00059
00064 GeneralFileHeader();
00065
00070 ~GeneralFileHeader();
00071
00076 bool IsEqual(GeneralFileHeader *that);
00077
00085 bool setRandom(double density, bool conformant);
00086
00092 bool deepCopyFrom(GeneralFileHeader *that);
00093
00099 std::string getHeaderItem(std::string item);
00100
00110 bool setHeader(std::string name, std::string source, std::string description,
00111 std::string fileCreator, std::string licence);
00112
00113 };
00114
00115
00119 class SparseVector
00120 {
00121 public:
00122
00128 SparseVector(int number);
00129
00134 SparseVector();
00135
00140 ~SparseVector();
00141
00146 bool bDeleteArrays;
00147
00151 int number;
00152
00156 int* indexes;
00157
00161 double* values;
00162
00163 };
00164
00165
00169 class SparseMatrix
00170 {
00171 public:
00172
00177 bool bDeleteArrays;
00178
00183 bool isColumnMajor;
00184
00188 int startSize;
00189
00193 int valueSize;
00194
00199 int* starts;
00200
00205 int* indexes;
00206
00211 double* values;
00212
00217 SparseMatrix();
00218
00227 SparseMatrix(bool isColumnMajor_, int startSize, int valueSize);
00232 ~SparseMatrix();
00233
00239 bool display(int secondaryDim);
00240
00241 };
00242
00243
00247 class SparseJacobianMatrix
00248 {
00249 public:
00250
00255 bool bDeleteArrays;
00256
00260 int startSize;
00261
00265 int valueSize;
00266
00271 int* starts;
00272
00277 int* conVals;
00278
00282 int* indexes;
00283
00287 double* values;
00288
00293 SparseJacobianMatrix();
00294
00301 SparseJacobianMatrix(int startSize, int valueSize);
00302
00307 ~SparseJacobianMatrix();
00308
00309 };
00310
00311
00312
00313
00314
00325 class SparseHessianMatrix
00326 {
00327 public:
00328
00333 bool bDeleteArrays;
00334
00338 int hessDimension;
00339
00343 int* hessRowIdx;
00344
00348 int* hessColIdx;
00349
00353 double* hessValues;
00354
00359 SparseHessianMatrix();
00360
00367 SparseHessianMatrix(int startSize, int valueSize);
00368
00373 ~SparseHessianMatrix();
00374
00375 };
00376
00380 class QuadraticTerms
00381 {
00382
00383 public:
00384
00389 int* rowIndexes;
00390
00394 int* varOneIndexes;
00395
00399 int* varTwoIndexes;
00400
00404 double* coefficients;
00405
00410 QuadraticTerms();
00411 ~QuadraticTerms();
00412 };
00413
00414
00415
00419 class IntVector
00420 {
00421 public:
00422 IntVector();
00423 ~IntVector();
00424
00425
00426 IntVector(int n);
00427
00432 bool bDeleteArrays;
00433 int numberOfEl;
00434 int *el;
00435
00439 bool IsEqual(IntVector *that);
00440
00450 bool setRandom(double density, bool conformant, int iMin, int iMax);
00451
00457 bool deepCopyFrom(IntVector *that);
00458
00464 bool setIntVector(int *i, int ni);
00465
00470 bool extendIntVector(int i);
00471
00475 int getNumberOfEl();
00476
00481 int getEl(int j);
00482
00483
00491 bool getEl(int *i);
00492 };
00493
00494
00500 class OtherOptionEnumeration : public IntVector
00501 {
00502 public:
00503 std::string value;
00504 std::string description;
00505
00506 OtherOptionEnumeration();
00507 ~OtherOptionEnumeration();
00508
00509
00510 OtherOptionEnumeration(int n);
00511
00516 bool IsEqual(OtherOptionEnumeration *that);
00517
00527 bool setRandom(double density, bool conformant, int iMin, int iMax);
00528
00534 bool deepCopyFrom(OtherOptionEnumeration *that);
00535
00543 bool setOtherOptionEnumeration(std::string value, std::string description, int *i, int ni);
00544
00545
00549 std::string getValue();
00550
00554 std::string getDescription();
00555
00556 };
00557
00558
00559
00563 class DoubleVector
00564 {
00565 public:
00566 DoubleVector();
00567 ~DoubleVector();
00572 bool bDeleteArrays;
00573 int numberOfEl;
00574 double *el;
00575
00576 bool IsEqual(DoubleVector *that);
00577 };
00578
00579
00583 struct IndexValuePair
00584 {
00588 int idx;
00589
00592 double value;
00593
00594 };
00595
00600 class BasisStatus
00601 {
00602 public:
00603 IntVector* basic;
00604 IntVector* atLower;
00605 IntVector* atUpper;
00606 IntVector* atEquality;
00607 IntVector* isFree;
00608 IntVector* superbasic;
00609 IntVector* unknown;
00610
00611 BasisStatus();
00612 ~BasisStatus();
00613
00618 bool IsEqual(BasisStatus *that);
00619
00629 bool setRandom(double density, bool conformant, int iMin, int iMax);
00630
00636 bool deepCopyFrom(BasisStatus *that);
00637
00645 bool setIntVector(int status, int *i, int ni);
00646
00653 bool addIdx(int status, int idx);
00654
00661 int getNumberOfEl(int status);
00662
00663
00671 int getEl(int status, int j);
00672
00682 bool getIntVector(int status, int *i);
00683
00697 int getBasisDense(int *resultArray, int dim, bool flipIdx);
00698 };
00699
00709 class StorageCapacity
00710 {
00711
00712 public:
00714 std::string unit;
00715
00717 std::string description;
00718
00720 double value;
00721
00726 StorageCapacity();
00731 ~StorageCapacity();
00732
00737 bool IsEqual(StorageCapacity *that);
00738
00746 bool setRandom(double density, bool conformant);
00747
00753 bool deepCopyFrom(StorageCapacity *that);
00754 };
00755
00767 class CPUSpeed
00768 {
00769
00770 public:
00772 std::string unit;
00773
00775 std::string description;
00776
00778 double value;
00779
00784 CPUSpeed();
00789 ~CPUSpeed();
00790
00795 bool IsEqual(CPUSpeed *that);
00796
00804 bool setRandom(double density, bool conformant);
00805
00811 bool deepCopyFrom(CPUSpeed *that);
00812 };
00813
00825 class CPUNumber
00826 {
00827
00828 public:
00830 std::string description;
00831
00833 int value;
00834
00839 CPUNumber();
00844 ~CPUNumber();
00845
00850 bool IsEqual(CPUNumber *that);
00851
00859 bool setRandom(double density, bool conformant);
00860
00866 bool deepCopyFrom(CPUNumber *that);
00867 };
00868
00878 class TimeSpan
00879 {
00880
00881 public:
00883 std::string unit;
00884
00886 double value;
00887
00892 TimeSpan();
00897 ~TimeSpan();
00898
00903 bool IsEqual(TimeSpan *that);
00904
00912 bool setRandom(double density, bool conformant);
00913
00919 bool deepCopyFrom(TimeSpan *that);
00920 };
00921
00922
00923
00924 class OSGeneral
00925 {
00926
00927 };
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939 enum ENUM_CPUSPEEDUNIT
00940 {
00941 ENUM_CPUSPEEDUNIT_hertz = 1,
00942 ENUM_CPUSPEEDUNIT_kilohertz,
00943 ENUM_CPUSPEEDUNIT_megahertz,
00944 ENUM_CPUSPEEDUNIT_gigahertz,
00945 ENUM_CPUSPEEDUNIT_terahertz,
00946 ENUM_CPUSPEEDUNIT_flops,
00947 ENUM_CPUSPEEDUNIT_kiloflops,
00948 ENUM_CPUSPEEDUNIT_megaflops,
00949 ENUM_CPUSPEEDUNIT_gigaflops,
00950 ENUM_CPUSPEEDUNIT_teraflops,
00951 ENUM_CPUSPEEDUNIT_petaflops
00952 };
00953
00954 inline int returnCPUSpeedUnit(std::string unit)
00955 {
00956 if (unit == "hertz" ) return ENUM_CPUSPEEDUNIT_hertz;
00957 if (unit == "kilohertz") return ENUM_CPUSPEEDUNIT_kilohertz;
00958 if (unit == "megahertz") return ENUM_CPUSPEEDUNIT_megahertz;
00959 if (unit == "gigahertz") return ENUM_CPUSPEEDUNIT_gigahertz;
00960 if (unit == "terahertz") return ENUM_CPUSPEEDUNIT_terahertz;
00961 if (unit == "flops" ) return ENUM_CPUSPEEDUNIT_flops;
00962 if (unit == "kiloflops") return ENUM_CPUSPEEDUNIT_kiloflops;
00963 if (unit == "megaflops") return ENUM_CPUSPEEDUNIT_megaflops;
00964 if (unit == "gigaflops") return ENUM_CPUSPEEDUNIT_gigaflops;
00965 if (unit == "teraflops") return ENUM_CPUSPEEDUNIT_teraflops;
00966 if (unit == "petaflops") return ENUM_CPUSPEEDUNIT_petaflops;
00967 return 0;
00968 }
00969
00970 inline bool verifyCPUSpeedUnit(std::string unit)
00971 {
00972 return (returnCPUSpeedUnit(unit) > 0);
00973 }
00974
00975 enum ENUM_STORAGEUNIT
00976 {
00977 ENUM_STORAGEUNIT_byte = 1,
00978 ENUM_STORAGEUNIT_kilobyte,
00979 ENUM_STORAGEUNIT_megabyte,
00980 ENUM_STORAGEUNIT_gigabyte,
00981 ENUM_STORAGEUNIT_terabyte,
00982 ENUM_STORAGEUNIT_petabyte,
00983 ENUM_STORAGEUNIT_exabyte,
00984 ENUM_STORAGEUNIT_zettabyte,
00985 ENUM_STORAGEUNIT_yottabyte
00986 };
00987
00988 inline int returnStorageUnit(std::string unit)
00989 {
00990 if (unit == "byte" ) return ENUM_STORAGEUNIT_byte;
00991 if (unit == "kilobyte" ) return ENUM_STORAGEUNIT_kilobyte;
00992 if (unit == "megabyte" ) return ENUM_STORAGEUNIT_megabyte;
00993 if (unit == "gigabyte" ) return ENUM_STORAGEUNIT_gigabyte;
00994 if (unit == "terabyte" ) return ENUM_STORAGEUNIT_terabyte;
00995 if (unit == "petabyte" ) return ENUM_STORAGEUNIT_petabyte;
00996 if (unit == "exabyte" ) return ENUM_STORAGEUNIT_exabyte;
00997 if (unit == "zettabyte") return ENUM_STORAGEUNIT_zettabyte;
00998 if (unit == "yottabyte") return ENUM_STORAGEUNIT_yottabyte;
00999 return 0;
01000 }
01001
01002 inline bool verifyStorageUnit(std::string unit)
01003 {
01004 return (returnStorageUnit(unit) > 0);
01005 }
01006
01007 enum ENUM_TIMEUNIT
01008 {
01009 ENUM_TIMEUNIT_tick = 1,
01010 ENUM_TIMEUNIT_millisecond,
01011 ENUM_TIMEUNIT_second,
01012 ENUM_TIMEUNIT_minute,
01013 ENUM_TIMEUNIT_hour,
01014 ENUM_TIMEUNIT_day,
01015 ENUM_TIMEUNIT_week,
01016 ENUM_TIMEUNIT_month,
01017 ENUM_TIMEUNIT_year
01018 };
01019
01020 inline int returnTimeUnit(std::string unit)
01021 {
01022 if (unit == "tick" ) return ENUM_TIMEUNIT_tick;
01023 if (unit == "millisecond") return ENUM_TIMEUNIT_millisecond;
01024 if (unit == "second" ) return ENUM_TIMEUNIT_second;
01025 if (unit == "minute" ) return ENUM_TIMEUNIT_minute;
01026 if (unit == "hour" ) return ENUM_TIMEUNIT_hour;
01027 if (unit == "day" ) return ENUM_TIMEUNIT_day;
01028 if (unit == "week" ) return ENUM_TIMEUNIT_week;
01029 if (unit == "month" ) return ENUM_TIMEUNIT_month;
01030 if (unit == "year" ) return ENUM_TIMEUNIT_year;
01031 return 0;
01032 }
01033
01034 inline bool verifyTimeUnit(std::string unit)
01035 {
01036 return (returnTimeUnit(unit) > 0);
01037 }
01038
01039 enum ENUM_TIMETYPE
01040 {
01041 ENUM_TIMETYPE_cpuTime = 1,
01042 ENUM_TIMETYPE_elapsedTime,
01043 ENUM_TIMETYPE_other
01044 };
01045
01046 inline int returnTimeType(std::string type)
01047 {
01048 if (type == "cpuTime" ) return ENUM_TIMETYPE_cpuTime;
01049 if (type == "elapsedTime") return ENUM_TIMETYPE_elapsedTime;
01050 if (type == "other" ) return ENUM_TIMETYPE_other;
01051 return 0;
01052 }
01053
01054 inline bool verifyTimeType(std::string type)
01055 {
01056 return (returnTimeType(type) > 0);
01057 }
01058
01059 enum ENUM_TIMECATEGORY
01060 {
01061 ENUM_TIMECATEGORY_total = 1,
01062 ENUM_TIMECATEGORY_input,
01063 ENUM_TIMECATEGORY_preprocessing,
01064 ENUM_TIMECATEGORY_optimization,
01065 ENUM_TIMECATEGORY_postprocessing,
01066 ENUM_TIMECATEGORY_output,
01067 ENUM_TIMECATEGORY_other
01068 };
01069
01070 inline int returnTimeCategory(std::string category)
01071 {
01072 if (category == "total" ) return ENUM_TIMECATEGORY_total;
01073 if (category == "input" ) return ENUM_TIMECATEGORY_input;
01074 if (category == "preprocessing" ) return ENUM_TIMECATEGORY_preprocessing;
01075 if (category == "optimization" ) return ENUM_TIMECATEGORY_optimization;
01076 if (category == "postprocessing") return ENUM_TIMECATEGORY_postprocessing;
01077 if (category == "output" ) return ENUM_TIMECATEGORY_output;
01078 if (category == "other" ) return ENUM_TIMECATEGORY_other;
01079 return 0;
01080 }
01081
01082 inline bool verifyTimeCategory(std::string category)
01083 {
01084 return (returnTimeCategory(category) > 0);
01085 }
01086
01087 enum ENUM_LOCATIONTYPE
01088 {
01089 ENUM_LOCATIONTYPE_local = 1,
01090 ENUM_LOCATIONTYPE_http,
01091 ENUM_LOCATIONTYPE_ftp
01092 };
01093
01094 inline int returnLocationType(std::string type)
01095 {
01096 if (type == "local") return ENUM_LOCATIONTYPE_local;
01097 if (type == "http" ) return ENUM_LOCATIONTYPE_http;
01098 if (type == "ftp" ) return ENUM_LOCATIONTYPE_ftp;
01099 return 0;
01100 }
01101
01102 inline bool verifyLocationType(std::string type)
01103 {
01104 return (returnLocationType(type) > 0);
01105 }
01106
01107 enum ENUM_TRANSPORT_TYPE
01108 {
01109 ENUM_TRANSPORT_TYPE_osp = 1,
01110 ENUM_TRANSPORT_TYPE_http,
01111 ENUM_TRANSPORT_TYPE_smtp,
01112 ENUM_TRANSPORT_TYPE_ftp,
01113 ENUM_TRANSPORT_TYPE_other
01114 };
01115
01116 inline int returnTransportType(std::string type)
01117 {
01118 if (type == "osp" ) return ENUM_TRANSPORT_TYPE_osp;
01119 if (type == "http" ) return ENUM_TRANSPORT_TYPE_http;
01120 if (type == "smtp" ) return ENUM_TRANSPORT_TYPE_smtp;
01121 if (type == "ftp" ) return ENUM_TRANSPORT_TYPE_ftp;
01122 if (type == "other") return ENUM_TRANSPORT_TYPE_other;
01123 return 0;
01124 }
01125
01126 inline bool verifyTransportType(std::string type)
01127 {
01128 return (returnTransportType(type) > 0);
01129 }
01130
01131 enum ENUM_SERVICE_TYPE
01132 {
01133 ENUM_SERVICE_TYPE_analyzer = 1,
01134 ENUM_SERVICE_TYPE_solver,
01135 ENUM_SERVICE_TYPE_scheduler,
01136 ENUM_SERVICE_TYPE_modeler,
01137 ENUM_SERVICE_TYPE_registry,
01138 ENUM_SERVICE_TYPE_agent,
01139 ENUM_SERVICE_TYPE_simulations
01140 };
01141
01142 inline int returnServiceType(std::string type)
01143 {
01144 if (type == "analyzer" ) return ENUM_SERVICE_TYPE_analyzer;
01145 if (type == "solver" ) return ENUM_SERVICE_TYPE_solver;
01146 if (type == "scheduler" ) return ENUM_SERVICE_TYPE_scheduler;
01147 if (type == "modeler" ) return ENUM_SERVICE_TYPE_modeler;
01148 if (type == "registry" ) return ENUM_SERVICE_TYPE_registry;
01149 if (type == "agent" ) return ENUM_SERVICE_TYPE_agent;
01150 if (type == "simulations") return ENUM_SERVICE_TYPE_simulations;
01151 return 0;
01152 }
01153
01154 inline bool verifyServiceType(std::string type)
01155 {
01156 return (returnServiceType(type) > 0);
01157 }
01158
01159 enum ENUM_GENERAL_RESULT_STATUS
01160 {
01161 ENUM_GENERAL_RESULT_STATUS_error = 1,
01162 ENUM_GENERAL_RESULT_STATUS_warning,
01163 ENUM_GENERAL_RESULT_STATUS_normal
01164 };
01165
01166 inline int returnGeneralResultStatus(std::string status)
01167 {
01168 if (status == "error" ) return ENUM_GENERAL_RESULT_STATUS_error;
01169 if (status == "warning") return ENUM_GENERAL_RESULT_STATUS_warning;
01170 if (status == "normal" ) return ENUM_GENERAL_RESULT_STATUS_normal;
01171 return 0;
01172 }
01173
01174 inline bool verifyGeneralResultStatus(std::string status)
01175 {
01176 return (returnGeneralResultStatus(status) > 0);
01177 }
01178
01179 enum ENUM_SYSTEM_CURRENT_STATE
01180 {
01181 ENUM_SYSTEM_CURRENT_STATE_busy = 1,
01182 ENUM_SYSTEM_CURRENT_STATE_busyButAccepting,
01183 ENUM_SYSTEM_CURRENT_STATE_idle,
01184 ENUM_SYSTEM_CURRENT_STATE_idleButNotAccepting,
01185 ENUM_SYSTEM_CURRENT_STATE_noResponse
01186 };
01187
01188 inline int returnSystemCurrentState(std::string status)
01189 {
01190 if (status == "busy" ) return ENUM_SYSTEM_CURRENT_STATE_busy;
01191 if (status == "busyButAccepting" ) return ENUM_SYSTEM_CURRENT_STATE_busyButAccepting;
01192 if (status == "idle" ) return ENUM_SYSTEM_CURRENT_STATE_idle;
01193 if (status == "idleButNotAccepting") return ENUM_SYSTEM_CURRENT_STATE_idleButNotAccepting;
01194 if (status == "noResponse" ) return ENUM_SYSTEM_CURRENT_STATE_noResponse;
01195 return 0;
01196 }
01197
01198 inline bool verifySystemCurrentState(std::string status)
01199 {
01200 return (returnSystemCurrentState(status) > 0);
01201 }
01202
01203 enum ENUM_JOB_STATUS
01204 {
01205 ENUM_JOB_STATUS_waiting = 1,
01206 ENUM_JOB_STATUS_running,
01207 ENUM_JOB_STATUS_killed,
01208 ENUM_JOB_STATUS_finished,
01209 ENUM_JOB_STATUS_unknown
01210 };
01211
01212 inline int returnJobStatus(std::string status)
01213 {
01214 if (status == "waiting" ) return ENUM_JOB_STATUS_waiting;
01215 if (status == "running" ) return ENUM_JOB_STATUS_running;
01216 if (status == "killed" ) return ENUM_JOB_STATUS_killed;
01217 if (status == "finished") return ENUM_JOB_STATUS_finished;
01218 if (status == "unknown" ) return ENUM_JOB_STATUS_unknown;
01219 return 0;
01220 }
01221
01222 inline bool verifyJobStatus(std::string status)
01223 {
01224 return (returnJobStatus(status) > 0);
01225 }
01226
01234 enum ENUM_BASIS_STATUS
01235 {
01236 ENUM_BASIS_STATUS_basic = 0,
01237 ENUM_BASIS_STATUS_atLower,
01238 ENUM_BASIS_STATUS_atUpper,
01239 ENUM_BASIS_STATUS_atEquality,
01240 ENUM_BASIS_STATUS_isFree,
01241 ENUM_BASIS_STATUS_superbasic,
01242 ENUM_BASIS_STATUS_unknown,
01243 ENUM_BASIS_STATUS_NUMBER_OF_STATES
01244 };
01245
01246 inline int returnBasisStatus(std::string status)
01247 {
01248 if (status == "basic" ) return ENUM_BASIS_STATUS_basic;
01249 if (status == "atLower" ) return ENUM_BASIS_STATUS_atLower;
01250 if (status == "atUpper" ) return ENUM_BASIS_STATUS_atUpper;
01251 if (status == "atEquality") return ENUM_BASIS_STATUS_atEquality;
01252 if (status == "isFree" ) return ENUM_BASIS_STATUS_isFree;
01253 if (status == "superBasic") return ENUM_BASIS_STATUS_superbasic;
01254 if (status == "unknown" ) return ENUM_BASIS_STATUS_unknown;
01255 return 0;
01256 }
01257
01258 inline bool verifyBasisStatus(std::string status)
01259 {
01260 return (returnBasisStatus(status) > 0);
01261 }
01262
01263 enum ENUM_SOLUTION_STATUS
01264 {
01265 ENUM_SOLUTION_STATUS_unbounded = 1,
01266 ENUM_SOLUTION_STATUS_globallyOptimal,
01267 ENUM_SOLUTION_STATUS_locallyOptimal,
01268 ENUM_SOLUTION_STATUS_optimal,
01269 ENUM_SOLUTION_STATUS_bestSoFar,
01270 ENUM_SOLUTION_STATUS_feasible,
01271 ENUM_SOLUTION_STATUS_infeasible,
01272 ENUM_SOLUTION_STATUS_unsure,
01273 ENUM_SOLUTION_STATUS_error,
01274 ENUM_SOLUTION_STATUS_other
01275 };
01276
01277 inline int returnSolutionStatus(std::string status)
01278 {
01279 if (status == "unbounded" ) return ENUM_SOLUTION_STATUS_unbounded;
01280 if (status == "globallyOptimal") return ENUM_SOLUTION_STATUS_globallyOptimal;
01281 if (status == "locallyOptimal" ) return ENUM_SOLUTION_STATUS_locallyOptimal;
01282 if (status == "optimal" ) return ENUM_SOLUTION_STATUS_optimal;
01283 if (status == "bestSoFar" ) return ENUM_SOLUTION_STATUS_bestSoFar;
01284 if (status == "feasible" ) return ENUM_SOLUTION_STATUS_feasible;
01285 if (status == "infeasible" ) return ENUM_SOLUTION_STATUS_infeasible;
01286 if (status == "unsure" ) return ENUM_SOLUTION_STATUS_unsure;
01287 if (status == "error" ) return ENUM_SOLUTION_STATUS_error;
01288 if (status == "other" ) return ENUM_SOLUTION_STATUS_other;
01289 return 0;
01290 }
01291
01292 inline bool verifySolutionStatus(std::string status)
01293 {
01294 return (returnSolutionStatus(status) > 0);
01295 }
01296
01297 enum ENUM_SOLUTION_SUBSTATUSTYPE
01298 {
01299 ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByLimit = 1,
01300 ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByBounds,
01301 ENUM_SOLUTION_SUBSTATUSTYPE_other
01302 };
01303
01304 inline int returnSolutionSubstatusType(std::string type)
01305 {
01306 if (type == "stoppedByLimit" ) return ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByLimit;
01307 if (type == "stoppedByBounds") return ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByBounds;
01308 if (type == "other" ) return ENUM_SOLUTION_SUBSTATUSTYPE_other;
01309 return 0;
01310 }
01311
01312 inline bool verifySolutionSubstatusType(std::string type)
01313 {
01314 return (returnSolutionSubstatusType(type) > 0);
01315 }
01316
01317 enum ENUM_PROBLEM_COMPONENT
01318 {
01319 ENUM_PROBLEM_COMPONENT_variables = 1,
01320 ENUM_PROBLEM_COMPONENT_objectives,
01321 ENUM_PROBLEM_COMPONENT_constraints
01322 };
01323
01324 enum ENUM_VARTYPE
01325 {
01326 ENUM_VARTYPE_CONTINUOUS = 1,
01327 ENUM_VARTYPE_INTEGER,
01328 ENUM_VARTYPE_BINARY,
01329 ENUM_VARTYPE_SEMICONTINUOUS,
01330 ENUM_VARTYPE_SEMIINTEGER,
01331 ENUM_VARTYPE_STRING
01332 };
01333
01334 inline int returnVarType(char vt)
01335 {
01336 if (vt == 'C') return ENUM_VARTYPE_CONTINUOUS;
01337 if (vt == 'B') return ENUM_VARTYPE_BINARY;
01338 if (vt == 'I') return ENUM_VARTYPE_INTEGER;
01339 if (vt == 'S') return ENUM_VARTYPE_STRING;
01340 if (vt == 'D') return ENUM_VARTYPE_SEMICONTINUOUS;
01341 if (vt == 'J') return ENUM_VARTYPE_SEMIINTEGER;
01342 return 0;
01343 }
01344
01345 inline bool verifyVarType(char vt)
01346 {
01347 return (returnVarType(vt) > 0);
01348 }
01349
01350
01351 enum ENUM_PATHPAIR
01352 {
01353
01354 ENUM_PATHPAIR_input_dir = 1,
01355 ENUM_PATHPAIR_input_file,
01356 ENUM_PATHPAIR_output_file,
01357 ENUM_PATHPAIR_output_dir
01358 };
01359
01360
01361
01362
01363
01364
01365
01366
01367 inline bool isEqual(double x, double y)
01368 {
01369 if (OSIsnan(x) && OSIsnan(y)) return true;
01370 if (x == y) return true;
01371 return false;
01372 }
01373
01377 enum ENUM_COMBINE_ARRAYS
01378 {
01379 ENUM_COMBINE_ARRAYS_replace,
01380 ENUM_COMBINE_ARRAYS_merge,
01381 ENUM_COMBINE_ARRAYS_ignore,
01382 ENUM_COMBINE_ARRAYS_throw
01383 };
01384
01385 #endif