00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _BasicData_h
00020 #define _BasicData_h
00021
00022
00023
00024
00025
00026
00027 #ifdef AIX
00028 #include <unistd.h>
00029 #else
00030 #include <dos.h>
00031 #endif
00032
00033 #include "BasicStrings.h"
00034
00035 #ifdef AIX
00036 long getTimeDiffInSecAIX(time_t t2, time_t t1);
00037 #else
00038
00039 #ifndef _MSC_VER
00040 void zeitdifferenz(struct time* t2, struct time* t1);
00041 double getTimeDiffInSecWIN(struct time* t2, struct time* t1);
00042 #endif
00043
00044 #endif
00045
00046
00047
00048 void exitfun();
00049
00050
00051
00052
00053 int NUM_CATCHMENTS();
00054 void setNUM_CATCHMENTS(int numC);
00055
00056
00057
00058 int NUM_SECTORS();
00059 void setNUM_SECTORS(int numS);
00060
00061
00062 int NUMINFLOWS(void);
00063 void setNUMINFLOWS(int numInflows);
00064
00065 int MONATE();
00066 int NW_ANZAHL();
00067 int SEG_ANZAHL();
00068 int POP_ANZAHL();
00069 int CLU_ANZAHL();
00070 int MAXLOOP();
00071 double SHARE_DEMAND_MET();
00072
00073 void setSHARE_DEMAND_MET(double share);
00074
00075
00076 void NODATAVAL_def(int);
00077 int NODATAVAL();
00078
00079 void set_MONATE(int maxM);
00080
00081
00082 void setWATER_RIGHTS(int flag);
00083 int WATER_RIGHTS();
00084
00085
00086
00087 int MAXINVEST();
00088 int HOECHSTALTER();
00089 int MINDESTALTER();
00090 int KOMM();
00091 int KUMM();
00092 double LAMBDA();
00093 double MARGE();
00094 double MINUMFANG();
00095 double OVERLAP();
00096 double RESERVE();
00097 int SYM_ANZAHL();
00098 double WAEHRUNG();
00099
00100
00101 double MINPACHT();
00102 double PACHTABSCHLAG();
00103 double PACHTZUSCHLAG();
00104
00105
00106 int BONUSALTER();
00107 int BONUSDAUER();
00108 int IRRIGATIONPROJECTS();
00109
00110
00111 int CONS_MDL();
00112 int CROPG_MDL();
00113 void setCROPG_MDL(int _crop_mdl);
00114
00115
00116
00117 int HYDRO_MDL();
00118 void setHYDRO_MDL(int _hydro_mdl);
00119
00120
00121
00122 int LIVST_MDL();
00123 int PERMC_MDL();
00124 int LANDM_MDL();
00125 int INPUT_GIS();
00126
00127
00128 int SPECL_MDL();
00129
00130
00131 double PLOTSIZE();
00132 void setPLOTSIZE(double _plotsize);
00133
00134 double CELLLENGTH();
00135 double DIST_COSTS();
00136 int TYPEN();
00137 int KLASSEN();
00138
00140 int DBG_INFOS();
00141 int DYNAMICS_OFF_ALL();
00142 int DYNAMICS_OFF_HOUSEHOLDS();
00143 int DYNAMICS_OFF_LIVESTOCK();
00144 int DYNAMICS_OFF_ASSETS();
00145 int DYNAMICS_OFF_SOIL_PROCESSES();
00146
00147 int get_NUMBER_SPIN_UP_ROUNDS();
00148 void set_NUMBER_SPIN_UP_ROUNDS(int numSpinUpRounds);
00149
00150
00151 double MIN_OBJV();
00152 int SAVE_MILP(int IdOfMilp);
00153 int SAVE_AGENT(int farmsteadID);
00154
00155
00156 int OSL_TUNE();
00157 double MAX_TIME();
00158 void SET_MAX_TIME(double max_time_);
00159 int MAX_ITER();
00160 int MAX_NODE();
00161
00162
00164
00165
00166
00167
00168
00169
00170
00171 int totMonth2actMonth(int mTot);
00172
00173
00174
00175
00176
00177
00178 typedef struct
00179 {
00180 char* sectorName;
00181 int lenDoubles;
00182 int lenInts;
00183 double* doubleVals;
00184 int* integerVals;
00185 } EDICtable;
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199 void setDYNAMICINFLOWS(bool);
00200 int DYNAMICINFLOWS();
00201
00202 bool SPATIAL_ON();
00203 void set_SPATIAL_ON(bool b);
00204
00205 bool DOPOSTPROCESSING();
00206 void set_DOPOSTPROCESSING(bool);
00207
00208 int WASIM_DELTAMONTH();
00209
00210
00211
00212
00213
00214 void ReadWasimFilenames();
00215 void PrintWasimFilenames();
00216
00217
00218
00219 void readBasicData();
00220 void writeBasicData(char* filename);
00221
00222 void readAllDefaults(string fn);
00223
00224
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253 bool TestFun(int testNr);
00254
00255 bool TestFunDestr(int testNr);
00256
00257 void TestFunInit(int max);
00258 int TestFun_getMax();
00259 void TestFun_setFalse(int testNr);
00260 void TestFun_setTrue(int testNr);
00261 void TestFun_printAllActive();
00262
00263
00264 bool SpatialExport(int v_);
00265 void SpatialExportDealloc();
00266
00267 void SpatialExportInit();
00268 int SpatialExport_getMax();
00269 void SpatialExport_setFalse(int v_);
00270 void SpatialExport_setTrue(int v_);
00271 void SpatialExport_printAllActive();
00272
00273
00274 void getReturnIf99();
00275 void getReturnIf99(int);
00276
00277
00278 string getCONTSTR(Content contIn);
00279 void printContString(Content cont);
00280 string returnContString(Content cont);
00281
00282
00283 string cont2string(Content cont);
00284 string exptp2string(ExportType tp);
00285
00287
00288 bool FilterFun(int filterNr);
00289 void FilterFunInit(int max);
00290 void FilterFunDealloc();
00291 int FilterFun_getMax();
00292 void FilterFun_setFalse(int filterNr);
00293 void FilterFun_setTrue(int filterNr);
00294 void FilterFun_printAllActive();
00295
00297
00298
00299 char* const2char(const char* exp);
00300 void const2char(const char* exp, char* out);
00301
00302
00303 string getOnlyNums(string& fn);
00304 string getOneToken(string& fn, string& rest);
00305 string getOneToken(string& fn);
00306
00307
00308
00309 void makeCharFrom3Int(char* irrigIDstr, int crA, int irrTech, int clusterNum);
00310
00311
00312
00314
00315
00316
00317
00318
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337 bool ExportViaTDT(ExportType tp);
00338 void ExportViaTDT_readFromFile(string fn);
00339
00340 int ExportViaTDT_getMax();
00341 void ExportViaTDT_setFalse(ExportType testNr);
00342 void ExportViaTDT_setTrue(ExportType testNr);
00343 void ExportViaTDT_printToScreen();
00344
00345
00346 bool ExportTable(ExportType tp);
00347 void ExportTable_printToScreen();
00348
00349 int ExportTable_getMax();
00350 void ExportTable_setFalse(ExportType testNr);
00351 void ExportTable_setTrue(ExportType testNr);
00352 void ExportTable_printToScreen();
00353
00354
00355
00356 int ExportType_firstAdditional();
00357
00359
00360
00362
00364 void setIRRIGMETHOD(int in);
00365 int IRRIGMETHOD();
00366
00367 void setIRRIGMETHOD(int in);
00368 int IRRIGMETHOD();
00369
00370 string FILENAME_InflowKey();
00371 void setFILENAME_InflowKey(string s);
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382 enum enumIrrigationFactorType {
00383 typeIrrig_cropWat2WasimIrrigationTable,
00384 typeIrrig_externalInflow2LiterPerSecond,
00385 typeIrrig_cropWatGross2LiterPerSecond,
00386 typeIrrig_cropWatExpected2LiterPerSecond,
00387 typeIrrig_activityKey2LiterPerSecond,
00388 typeIrrig_activityKey2mmPerDay,
00389 typeIrrig_CropKey2mmPerDay,
00390 typeIrrig_MAX,
00391 typeIrrig_ErrorOutput
00392 } ;
00393
00394
00395 void irrigationFactors_printOptions();
00396 void irrigationFactors_printCurrentSetting();
00397
00398
00399 void setIrrigationDefaults();
00400 int readIrrigationFactors(string fn);
00401 void setIRRIGFACTOR(int unitType, enumIrrigationFactorType conversionType);
00402
00403
00404 double IRRIGFACTOR(enumIrrigationFactorType conversionType);
00405 int getIrrigationUnitType(enumIrrigationFactorType conversionType);
00406 int getIrrigUnitForWasimUnit(int conversionID);
00407 double getFactorFromUnitType(int conversionID);
00408
00409
00410 string irrigationUnitToString(int conversionID);
00411 string getIrrigationFactorDescription(enumIrrigationFactorType);
00412
00413
00414
00415
00416
00417
00419
00420
00421
00422
00423 void deallocateUtilities();
00424
00425
00426 void TestFunDealloc();
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439 void ExportTable_readFromFile(string fn);
00440
00441 void setINFLOWINFO(int pos, int val, string name);
00442
00443
00444
00445 int readInflowKey(string fn);
00446
00448
00450
00451
00452 string INFLOW_val2name(int val);
00453
00454
00455
00456 string INFLOW_pos2name(int pos);
00457
00458
00459 int INFLOW_pos2val(int pos);
00460
00461
00462
00463
00464
00465 int INFLOW_val2pos(int pos);
00466
00467 void printINFLOWS(void);
00468
00469
00470
00471 bool checkClassCorrespondsWithType(int cl, int tp);
00472
00473
00474 int soilClassOrder(int priority);
00475 void set_soilClassOrder();
00476
00477 void readSoilclass(FILE* bdata);
00478 void writeSoilClass(FILE* bdata);
00479
00480
00481
00482 string getFullMpmasFilename(
00483 EnumFileType fileTypeEnum_,
00484 Content cont,
00485 int CatchmentID, int year, int month);
00486 string getTestFilename(string s, int CatchmentID);
00487
00488 int SEED();
00489 void setSEED(int seed_);
00490
00491
00492 void setSTOPYEAR(int stopyear_);
00493 int STOPYEAR();
00494
00495 void setIDUM(long idum_);
00496 long IDUM();
00497
00498 int MAXPERIODIN();
00499 void setMAXPERIODIN(int maxPeriodIn_);
00500
00501 string getTDTConfigFilename(TypeDataExchangeChannel, TypeDataExchangeType);
00502 string filenameConfigFile(TypeRoleInCoupling roleInCoupling);
00503
00504 void printAllIrrigationMethods();
00505 string getStringIrrigationMethods(typeIrrigationMethod);
00506
00507
00508
00509 void setCANAL_MODEL(int _canalModelType);
00510 int CANAL_MODEL();
00511
00512
00513 void setCANAL_INTERNAL_REUSE(int _canalModelType);
00514 int getCANAL_INTERNAL_REUSE();
00515
00516 void setCANAL_BETA_SHARE(double _betaShare);
00517 double getCANAL_BETA_SHARE();
00518
00519 void setCANAL_LOSSFACTOR(double _canalLosses);
00520 double getCANAL_LOSSFACTOR();
00521
00522 void setCANAL_LAMBDA(double _canalLambda);
00523 double getCANAL_LAMBDA();
00524
00525 void initializeCanalDefault();
00526 void readCanalFile(string fn);
00527
00528 void setCanalFilename(string fn);
00529 string getCanalFilename();
00530
00531 void setWASIM_SPINUP(string fn);
00532 string WASIM_SPINUP();
00533
00534
00535 #endif
00536
00537
00538
00539