Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

AgentParcel.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 //
00003 //  Thomas Berger (main author), Pepijn Schreinemachers, and Thorsten Arnold
00004 //
00005 //
00006 //  Hohenheim University (490d)
00007 //  Professorship for Land Use Economics in the Tropics and Subtropics
00008 //
00009 //  May not be distributed without permission by main author
00010 //
00011 //  File:       AgentParcel.h (formerly parzelle.h)
00012 //
00013 //  Contents:   Parcel class containing coordinates, ownership and user data,
00014 //              for example in case of renting-in and renting-out
00015 //
00016 //
00017 //------------------------------------------------------------------------------
00018 
00019 
00020 #ifndef _AgentParcel_h
00021 #define _AgentParcel_h
00022 
00023 #include "CropSoil.h"
00024 
00025 class parzelle
00026 {  protected:
00027         int x;          //x-Koordinate (Spalten-nr)
00028    int y;      //y-Koordinate (Zeilen-nr)
00029    int typ;             //Bodentyp der Parzelle
00030    int b_nr;    //Betriebsnr. des Besitzers (und möglichen Verpächters)
00031         int b_sc;       //Subcatchment-Nr des Besitzers (und möglichen Verpächters)
00032    int p_sk;    //Num_Sector der Parzelle
00033         double entf;//Entfernung zur Hofstelle
00034         int zustand;//mögliche Zustände: 0 brach, 1 Hofstelle, 2 Dauerkultur,
00035                                         //3 einjährige Kultur, 4 verpachtet
00036 
00037    //neu 2004 TSPC crop-soil module
00038    int nruID;  //ID nutrient response unit
00039    lUseH luHis;//land use history
00040    sProc* slPro;//soil processes
00041 
00042    //Arnold2006_30
00043    bool hasCrop;      // this parcel was allocated to a specific cropping activity
00044    int  cropA;        // ID for specific cropping activity
00045    // Vector with entry of irrrigation quantity in every month
00046    double* irrigQ;        //Quantity of irrigation water applied in this parcel
00047 
00048 
00049    double precip;
00050    double soilMoisture;
00051 
00052 
00053         public:
00054         //Übergabe: x-Koord., y-Koord., Bodentyp, Betriebsnr., SubcatchmentNum, Sektornr.,
00055         //Zustand, Entfernung
00056         parzelle(int, int, int, int, int, int, int = 1, double = 0.0);
00057         virtual ~parzelle()
00058         {  delete slPro;
00059       //Arnold2006_30
00060       delete [] irrigQ;
00061         }
00062 
00063         //für die Betriebsparzellenliste
00064    parzelle* nextParzelle;
00065         parzelle* prevParzelle;
00066 
00067    void setNextPtr_P (parzelle*);
00068    parzelle* getNext_P();
00069 
00070    void setPrevPtr_P (parzelle*);
00071    parzelle* getPrev_P();
00072 
00073 
00074         //Elementfunktionen liefern geschützte Informationen zurück
00075         virtual int get_x();
00076         virtual int get_y();
00077    //Arnold2006_40
00078         virtual int get_col();
00079         virtual int get_row();
00080         virtual int get_typ();
00081    //virtual int get_klasse();
00082         virtual int get_bnr();
00083    int getCatchmentOfOwner() {  return b_sc;}
00084 
00085         virtual int get_psc();//##statt Subcatchment der Parzelle hier: Besitzer
00086         virtual int get_psk();
00087         virtual int get_zustand();
00088    virtual double get_entf();
00089 
00090    //Elementfunktionen zur Veränderung der Eigenschaften
00091    virtual void set_bnr(int);
00092    virtual void set_typ(int);
00093         virtual void set_entf(double);
00094         virtual void hofstelle();//Parzelle mit Hofstelle besetzen
00095         virtual void raeumen();//Parzelle auf Brache setzen
00096    virtual void belegen();//Parzelle mit Dauerkultur belegen
00097         virtual void verpachten();//Parzelle als verpachtet markieren
00098 
00099    //neu 2004 TSPC crop-soil model
00100    virtual int getNruID();
00101    virtual void setNruID(int);
00102    virtual void setSoilProc(sProc*& sPro);
00103    virtual void setLandUseH(const lUseH& ldUs);
00104    virtual sProc* getSoilProc(void);
00105    virtual lUseH getLandUseH(void);
00106    virtual void updateLandUseH(double STN, double RES, double MAN);
00107 
00108    virtual void printToScreen();
00109         virtual void writeToFile(ofstream& out);
00110         virtual void writeToBuffer(char* buffer);
00111 
00112    //Arnold2006_30
00113    bool get_hasCrop(void) { return hasCrop;};
00114    void set_hasCropTrue(void) {hasCrop = true;};
00115    void set_hasCropFalse(void) {hasCrop = false;};
00116 
00118    // NOT FULLY FINALIZED ... needs to switch over all sub values!
00119    // ... Ideal: Handling in array that is 
00120    //     accessed via ContentType
00121    void setByContent(Content cont,double val);
00122    double getByContent(Content cont);   
00123    
00124    void setByContent_monthly(Content cont, int month, double val);
00125    double getByContent_monthly(Content cont, int month);   
00126 
00127    // ---> All these are within the generic function 
00128    void set_cropA(int crA) {cropA = crA;};
00129    int get_cropA(void) {return cropA;};
00130 
00131    void set_Precip(double precip_) {precip = precip_;};
00132    double get_Precip() {return precip;};
00133 
00134    void set_SoilMoisture(double soilMoisture_) {soilMoisture = soilMoisture_;};
00135    double get_SoilMoisture() {return soilMoisture;};
00136 
00137    //real months
00138    void  set_irrigQ(double q, int mTot);
00139    double get_irrigQ(int mTot);
00140 
00141    // <---- END included in generic function
00142 
00143 };
00144 
00145 
00146 #endif
00147 

Generated on Thu Aug 28 12:38:44 2008 for MPMAS by  doxygen 1.3.9.1